How can I access the the rows selected in a WebDataGrid on the server side?
For example, I have a WebDataGrid and I've enabled the Selection behavior fot it. I want the user to be able to select a row in the WebDataGrid then click a button which calls server side code to process the selected row (i.e. getting the values of some of the columns of the selected row).
I think I need to use the SelectedRowsCollection somehow, but not sure how to use it with my WebDataGrid.
Thanks,
John
this may be a other solution: in WebDataGrid You must set
EnableDataViewState="True" ViewStateMode="Enabled" AND Open selection option
<ig:Selection CellClickAction="Row" RowSelectType="Single" ....>
foreach (Infragistics.Web.UI.GridControls.GridRecord r in WebDataGrid1.Behaviors.Selection.SelectedRows) { if (r != null) {
XX = r.Items[WebDataGrid1.Columns["Name"].Index].Value.ToString(); //well be get Cell value or text
}
thank you, this helped.
Hi Everyone,
i found a workaround to get the current row in index in Server Side, Hope the following code will help
string currentRowIndex = this.WebDataGrid1.Behaviors.Activation.ActiveCell.Row.Index.ToString();
Regards,
Abhishek
Hi,
Can you please post a simple website reproducing the issue? Its hard to tell what is going on from the code snipet.
Thank You,
Olga
Am not binding datasource in source page am binding in server side.and EnableDataViewState is true then also when i select a row its passing null value
{
Please give solution as soon as possible.Its urgent.Thanks in advance