I have tried searching the forums, but don't quite see the code for what I'm trying to do. I have an web grid, and have added an unbound checkbox as the first column of the grid. I have used this code:
gridAssigned.Columns[0].Type = Infragistics.WebUI.UltraWebGrid.ColumnType.CheckBox;
That works fine. I don't need to save the values or be able to select all or anything. All I want to do now is capture the event as soon as a checkbox is clicked and perform some action. I am just not sure how to do this. Do I need to set AllowUpdate to true? Do I need to add something in the InitializeComponent? I created a sub called
protected void gridAssigned_CellChange(object sender, CellEventArgs e)
and put my code in there, but it never hits that. Any help would be greatly appreciated.
Thanks!
Works fine.
I also have another question. How can I collect the row indexes of the check boxes that are selected in a hidden variable and then use the value of the hidden variable to retrieve the rows selected.
Because on every server side call for update cell, looks like I cannot handle more than one check box at a time.
ThanksNirmal
fyi, I am using 2008 Vol 1 and I do not see any event handlers for cell change on the server side. My scenario is the exact same as what you do.
Any help would be much appreciated?
I used OnUpdateCell. I am not sure when the other ones you listed are used, but they may do the trick as well.
What is the EventHandler definition for CellChange. I am unable to find from the available definitions.
Is it SelectedCellsChange? or ActiveCellChange?
I got it working a few minutes after writing my question. I did the same as what I was saying in my post, but I guess I had the syntax wrong at first. Basically, I created the new column with:
gridAssigned.Columns.Insert(0, "UnAssign"); gridAssigned.Columns[0].Type = Infragistics.WebUI.UltraWebGrid.ColumnType.CheckBox;
Then I added:
gridAssigned.DisplayLayout.AllowUpdateDefault = AllowUpdate.No;gridAssigned.Columns[0].AllowUpdate = AllowUpdate.Yes;
This is so the update would occur only when I clicked the check box, not any other cell of the grid.
Then, I had the following:
and it hit that every time I clicked the checkbox. So I guess the only thing I was missing was the AllowUpdate. I don't know if CellChange is depracated or not, but it is working fine for what I need to do. I am using version 2007, vol 3 of the grid.