or
private string _filterExpression;
protected void RadGrid1_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
{
int startRowIndex = RadGrid1.CurrentPageIndex * RadGrid1.PageSize;
int maximumRows = RadGrid1.PageSize;
string sort = RadGrid1.MasterTableView.SortExpressions.GetSortString();
_filterExpression = RadGrid1.MasterTableView.FilterExpression;
//needed to bypass RadGrid's internal filtering
RadGrid1.MasterTableView.FilterExpression = string.Empty;
if (configuration == null)
{
configuration = new SystemSetupFieldConfiguration(TagPrefixList, startRowIndex, maximumRows, sort, _filterExpression);
}
var combinedfields = configuration.GetCombinedFields();
var fieldcount = configuration.CombinedFieldsCount;
RadGrid1.VirtualItemCount = fieldcount;
RadGrid1.DataSource = combinedfields;
}

protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e){ var Eds = new EntityDataSource(); Eds.DefaultContainerName = "EntityDb"; Eds.ConnectionString = "name=EntityDb"; Eds.EntitySetName = "Meetings"; Eds.EnableDelete = true; Eds.EnableInsert = true; Eds.EnableUpdate = true; Eds.AutoPage = true; Eds.Include = "Venue"; Eds.OrderBy = "it.StartDate"; RadGrid1.DataSource = Eds;}protected void RadGrid1_NeedDataSource(object source, Telerik.Web.UI.GridNeedDataSourceEventArgs e){ OleDbConnection conn = new OleDbConnection("Provider=Microsoft.Jet.OLEDB.4.0; Data Source=" + Server.MapPath("~/App_Data/Nwind.mdb")); OleDbDataAdapter adapter = new OleDbDataAdapter(); adapter.SelectCommand = new OleDbCommand("SELECT * FROM Customers", conn); DataTable myDataTable = new DataTable(); conn.Open(); try { adapter.Fill(myDataTable); } finally { conn.Close(); } RadGrid1.DataSource = myDataTable;}
protected
void grdDelegation_ItemCommand(object source, GridCommandEventArgs e)
{
try
{
hdnDelegationCommandName.Value = e.CommandName;
switch (e.CommandName)
{
case RadGrid.EditCommandName:
hdnDelegationGridAddUpdate.Value =
"2";
if (grdDelegation.MasterTableView.IsItemInserted)
{
e.Canceled =
true;
}
break;
case RadGrid.InitInsertCommandName:
//Pair filterPair = (Pair)e.CommandArgument;
//TextBox filterBox = (e.Item as GridFilteringItem)[filterPair.Second.ToString()].Controls[0] as TextBox;
//filterBox.Text = "";
<style type="text/css" > .RadListBox1 div.rlbHeader { height:25px; } </style> <asp:Panel runat="server" id="pnlCustomFieldListValues" CssClass="fieldPanel" Visible="false"> <div style="float: left; width: 750px;"> <asp:Label ID="Label2" runat="server" AssociatedControlId="radCustomFieldListValues" Text="List Values:" /> <telerik:RadListBox runat="server" ID="radCustomFieldListValues" Width="100%" Height="200px" SelectionMode="Single" AllowReorder="true" AllowDelete="true" EnableDragAndDrop="true" DataValueField="Id" ButtonSettings-ReorderButtons="All" ButtonSettings-ShowDelete="true" CssClass="RadListBox1" > <HeaderTemplate> <asp:Label runat="server" Width="200" Text="Name" /> <asp:Label runat="server" Width="200" Text="Value" /> </HeaderTemplate> <ItemTemplate> <asp:Label runat="server" ID="lblListValueName" Width="200" Text='<%# DataBinder.Eval(Container.DataItem, "Name")%>' /> <asp:Label runat="server" ID="lblListValue" Width="200" Text='<%# DataBinder.Eval(Container.DataItem, "Value")%>' /> </ItemTemplate> </telerik:RadListBox> </div> </asp:Panel> 