C# Gridview - Set header row tooltip programatically - c#

I have a gridview which has 2 header rows as below
| Name | Subject1 | Subject2 |
| | T | V | T | V |
|-------|-----|-------|-----|-------|
| John | 80 | 20 | 78 | 18 |
| Ann | 75 | 18 | 68 | 15 |
The grid view data source is a data table which i have created dynamically. Header rows are also created dynamically.
Now I want to set tooltip for the second header row as 'Theory' for 'T' and 'Viva' for 'V'.
By using gvMarks.HeaderRow.Cells[1].Tooltip, I am able to set tooltip only for the first header row.
If I use gvMarks.Rows[1].Cells[1].Tooltip, I am able to access only the grid data rows.
How can I access the second header row so that I can set the tooltip programatically.

Related

Devexpress Gridview Data Row and Columns Value

Please refer to the simple table below.
I don't know how to save all data.
GRIDVIEW:
COLUMN1| COLUMN2 | COLUMN3 | COLUMN4 | COLUMN |....
ROW1 | 100 | 105 | 109 | 112 |
ROW2 | 55 | 58 | 62 | 67 |
ROW3 | 71 | 75 | 79 | 83 |
ROW4 | 204 | 209 | 216 | 221 |
ROW..
gridviewRowsColumns
Notes:
First column = stock code, (in tag property, contain ID)
Columns COLUMN1, COLUMN2, COLUMN3.... sales prices for stock.

Editing C# property value from SQL Server when multiple rows provide answer in SQL

Assume I have a SQL table thus:
[Sample Data]
ID1 --------| ID2 | EditColumn | EditValue
T1017TF | 142 | EyeColor | 1
T1017TF | 142 | EyeColor | 2
T1017TF | 142 | HairColor | F
T1017TF | 142 | WeightClass | A1
T1017TF | 142 | WeightClass | A2
T1017TF | 142 | AcceptablePulse | 1
T1017TF | 142 | AcceptablePulse | 3
From C# assuming I have the EditValue of each EditColumn in a .Net Class Property corresponding to combined keys ID1 AND ID2. So, for Key T1017TF/142, the WeightClass= 'A1'or 'A2' would pass validation, but A3 would not. For a given key combo (T1017TF/142), I must edit for each EditColumn.
What is the best manner in C# or Tranact SQL (up to 2016) to edit repeatedly for each EditColumn? I must be overthinking this..
Thank you ahead of time

Doing Calculations of a group

I have a Visual Studio Program where the user enters specific data of production for that day. Example:
Date | Part Number | Mold Num | Machine Num | Total Parts |Cycle
2/12/2016 | 1185-5B8 | 6580 | 12 | 220 | 56
2/12/2016 | 2249300 | 7797 | 36 | 600 | 13
2/12/2016 | 146865 | 5096789 | 56 | 500 | 15
2/16/2016 | 123456 | 7787 | 54 | 300 | 34
2/16/2016 | 123456 | 787 | 54 | 360 | 36
2/16/2016 | 123456 | 777 | 54 | 500 | 46
2/16/2016 | 123456 | 87 | 54 | 400 | 44
I'm trying to have people enter production data and then manipulate it in order to get the machine usage (MU) (Equation: Total Parts/(3600/Cycle). I want to get these things for each day and for a specific month when I call it. I looked at what others have done but they are just counting how many are in a specific date but I need to multiply, and divide other columns together in two different tables with the same dates in order to get what I need.
Example output:
2/12/2016: MU = 41.12%
2/16/2016: MU = 24.79%
February: MU = 32.96%
EDIT:
I would like to do something in the lines of this example but I do not know how to implement it to an already existing DataSet.
Grouping and Sum Datatable by two fields with different Where conditions
or this example:
Calculating percentage of a groups from datatable

How to get SAP DDIC table structure in C#?

I'm writing some codes about extract table's structure from SAP using C#, and I've got a question about RFC_READ_TABLE, when I define a table's name and the FIELDS table returned 5 columns, like : FIELDNAME, OFFSET, LENGTH, T and FIELDTEXT, actually I couldn't know what's the decimal places of a numeric field according to these 5 columns, is there any other way to get this? Please be noted that my SAP account is a public one because other peoples are also using it, I'm not supposed to create new function module in SAP.
Below info was what I got from FIELDS table of module RFC_READ_TABLE:
MANDT | 000000 | 000003 | C | Client**: length * 3**
BUKRS | 000003 | 000004 | C | Company Code: **length * 3**
ANLN1 | 000007 | 000012 | C | Main Asset Number: **length * 3**
ANLN2 | 000019 | 000004 | C | Asset Subnumber: **length * 3**
GJAHR | 000023 | 000004 | N | Fiscal Year: **numeric(4,0)**
LNRAN | 000027 | 000005 | N | Sequence Number of Asset Line Items in Fiscal Year: **numeric(5,0)**
AFABE | 000032 | 000002 | N | Real depreciation area: **numeric(2,0)**
ZUJHR | 000034 | 000004 | N | Asset acquisition year (currently not used): **numeric(4,0)**
ZUCOD | 000038 | 000004 | N | Sub-classification of asset acquisitions(currently not used): **numeric(4,0)**
AUFWV | 000042 | 000013 | P | Proportional cumulative revaluation on replacement value: **numeric(13,??=2)**
The datatype of this field is numeric(13,2) according to DB, but how can I get this clue?
thanks in advance!
RFC_READ_TABLE FM returns only summary of field. You can use DDIF_FIELDINFO_GET FM for details.

Show data from two model with same column name same value in ASP.NET

I'm new to ASP.NET, I have only experiences in C# Windows Form and SQL Server. Now I have starting my new project in ASP.NET MVC and already have database from my customer. It has two model included some same column name like this:
Table 1
---------------------------------
| Location | Item | Model | Tag |
---------------------------------
| 1 | 10 | A5 | 221 |
| 2 | 10 | A6 | 233 |
| 3 | 12 | A8 | 332 |
| 4 | 15 | C1 | 223 |
Table 2
-------------------------------------------------
| Location | Item | Model | Tag | DWeek | DYear |
-------------------------------------------------
| 1 | 10 | A5 | 221 | 01 | 15 |
| 2 | 10 | A6 | 233 | 01 | 15 |
| 3 | 12 | A8 | 332 | 02 | 15 |
| 4 | 15 | C1 | 223 | 03 | 15 |
I just want to show the data which have same Location and Item in one table, I don't know how to query in Entity framework, I have only know how to code by SQL, and I think it seem to be like this:
select
r.Location
,r.Item
,d.Location
,d.Item
,d.DWeek
,d.DYear
,r.Model
,r.[Tag No]
,d.[Tag No]
from Register r, Due d
where r.Location = d.Location
and r.Item = d.Item
My question is how to query like this in Entity framework for show data in a view, and is it possible to update and create two model in the same time?
I am using Lambda Expression
var Query=Register.Join(Due,r=>r.Location,d=>d.Location,(r,d)=>new {r,d}).Where(
X=>X.r.Location = X.d.Location && X.r.Item = X.d.Item).Select(X=>new {
LOCATION_1 =X.r.Location;
ITEM_1=X.r.Item;
LOCATION_2=X.d.Location;
ITEM_2=X.d.Item;
DWEEK=X.d.DWeek;
DTEAR=X.d.DYear;
MODEL=X.r.Model;
TAGNO_1=X.r.Tag_No;
TAGNO_1=X.d.Tag_No;
}).ToList();

Categories

Resources