or
protected void RefreshData() |
{ |
DataSet ds; |
string query; |
string tableName; |
// clear old data |
UserMsg.Text = ""; |
Cache.Remove("wadv_ds"); |
clearGrid(); |
// get data |
tableName = cbTableList.SelectedValue; |
query = @"SELECT * FROM " + tableName; |
ds = dba.ReadData(query, tableName); |
// update grid |
if (ds == null) |
{ |
UserMsg.Text = "DataSet is null."; |
} |
else if (ds.Tables[0].Rows.Count == 0) |
{ |
UserMsg.Text = "Table has no data."; |
} |
else |
{ |
Cache["wadv_ds"] = ds.Tables[0]; |
rgData.DataSource = ds.Tables[0]; |
rgData.DataBind(); // <=== ERROR OCCURS HERE |
} |
} |
//------------------------------------------------------------------------- |
protected void clearGrid() |
{ |
rgData.DataSource = null; |
rgData.DataBind(); |
rgData.Columns.Clear(); |
} |
//------------------------------------------------------------------------- |
public static void resetForm(Control parent)
{
foreach (Control c in parent.Controls)
{
if (c.Controls.Count > 0)
{
resetForm(c);
}
else
{
switch (c.GetType().ToString())
{
case "Telerik.Web.UI.RadTextBox":
((RadTextBox)c).Text = "";
break;
case "Telerik.Web.UI.RadComboBox":
((RadComboBox)c).ClearSelection();
((RadComboBox)c).Text = string.Empty;
break;
case "Telerik.Web.UI.RadTimePicker":
((RadTimePicker)c).Clear();
break;
case "Telerik.Web.UI.RadDatePicker":
((RadDatePicker)c).Clear();
break;
case "System.Web.UI.WebControls.CheckBox":
((CheckBox)c).Checked = false;
break;
}
}
}
}
<telerik:RadGrid runat="server" ID="RadGrid1" AutoGenerateColumns="false" AllowMultiRowSelection="true">
<MasterTableView TableLayout="Fixed">
<Columns>
<telerik:GridBoundColumn DataField="Dialog" HeaderText="Dialog" DataType="System.String" />
</Columns>
</MasterTableView>
<ClientSettings EnableRowHoverStyle="true">
<Selecting AllowRowSelect="True" />
<ClientEvents OnRowSelected="RowSelected"/>
</ClientSettings>
</telerik:RadGrid>
And the OnRowSelected event triggers for each row selected. When selecting 10 rows, the event gets fired 10 times. Simple enough.
My question is what event can I listen to to know when all the rows that are going to be selected are selected (as a result of the multiple selection)? I need to make a post request with the ids of the selected rows and I don't think it's a good idea to let 10 post request be made. I can query the grid to get the selected rows, I just need to know when to do it; ideally something that doesn't involve timeouts. There must an event for this that I'm overlooking.