Hi,
I am new to this forum, Please tell the solution to this issue?
I am using Ultrawebgrid , directly it have one datasource value. Can i change the datasource at runtime, ?
1. Ultrawebgrid have a lot of controls, i want get the value of the particular row..?For Example : one column have webnumeric control , i want to
get the value of the particular row value...
Each column have EditcontrolId, how can i assign the value to the controls?
With Regards,
Raji
1. Can i change the datasource at runtime, ?
Yes, you can, But you have to take care of column names that are already assigned. (or) You can change the grid layout dynamically based on requirements.
2. i want get the value of the particular row..?
row.Cells.FromKey(ColumnName).Text
row.Cells.FromKey(ColumnName).Value
3. Each column have EditcontrolId, how can i assign the value to the controls?
You assign the value to columns using following syntax. Editor controls also renders the same data.
ColumnName.BaseColumnName = "DataSourceColumnName";
In case If you are doing any kind of customization you can handle row initializa event.
Hope this will help you.
Thanks,
Kedar.
Thanks for your quick respone,
If i assign the value to the cell, after postback the data is not shown in that cell.
structure is, col1,col2,result [this is the ultrawebgrid column]
col1*col2 = result.
10 10 100
when i click the button the calculation will updated in the cell,after clicking some event [postback]. values not shown in the cell
pl tell me how to solve this issue?
rajalakshmi2008 said: If i assign the value to the cell, after postback the data is not shown in that cell.
In what event handler are you doing this?
It often helps if you post any applicable markup and code.
Thank u so much for quick response.
Code :
When i click the button control :[ Button click event] : this code will execute and update in cell.if some other events occured, then the cell value is empty. how can i solve this issue.
int dcnt = grdBIDResponseItemLinkLDLink.DisplayLayout.Rows.Count; for (int j = 0; j < dcnt; j++) { double pts = Convert.ToDouble(grdBIDResponseItemLinkLDLink.DisplayLayout.Rows[j].Cells.FromKey("PurchaseDiscountPercentage").Value);
double gamt = Convert.ToDouble(grdBIDResponseItemLinkLDLink.DisplayLayout.Rows[j].Cells.FromKey("GrossAmount").Value); double tot = gamt* pts ; grdBIDResponseItemLinkLDLink.DisplayLayout.Rows[j].Cells.FromKey("BIDLineDiscountLinkAmount").Value = tot; }
I've never seen "grid.DisplayLayout.Rows". I use "grid.Rows".
Thank u for your quick response,
If i use grid.row, after refresh the page the value is not shown in the grid.
how to solve this issue
with regards,
raji
AFAIK, you can't do that with a checkbox column, but you could implement a templated column with a label and a checkbox, and then show one and hide the other as applicable (in your InitializeRow event, I think).
I have a checkbox column in UltraWebGrid. I want assign string value for one of the cell of that column. e.g. N/A.
How can I do that? Is it possible?
Please Help....
Thanks
I'm not sure, but my understanding is that by default, a grid re-databinds itself each time it posts back. If you have unbound, calculated fields, you may need to recalculate them every time you postback.