| <telerik:GridTemplateColumn HeaderText="Profit"><ItemTemplate> |
| <asp:Label ID="profit" runat="server"></asp:Label></ItemTemplate> |
| </telerik:GridTemplateColumn> |
if
(Assembly.GetAssembly(typeof(ScriptManager)).FullName.IndexOf("3.5") != -1)
{
grdsearchresult.MasterTableView.FilterExpression =
@"it[""FileParentID""] = Convert.DBNull";
}
else
{
grdsearchresult.MasterTableView.FilterExpression =
"FileParentID IS NULL";
}
For Eg:
List
<SearchResult> listSearchResults=new List<SearchResult>();
grdsearchresult.DataSource = listSearchResults;
grdsearchresult.DataBind();
Here my datasource is List Type Object.The grid shows all records if I dont filter it.
So While binding the master records I get error index is not defined.?
Can't I bind the RADGrid with list object and provide filter to it.
Please reply.
Thanks,
Yuvika

| protected void gvManualOrder_ItemCreated(object sender, GridItemEventArgs e) |
| { |
| if (e.Item is GridDataItem) |
| { |
Hello, this is my code for bind a dropdowlist in ItemTemplate that has a Bind("field")
it's work fine, but in Edit Mode one time in
list.DataSource = dsDropDown
give the error:
{"Object reference not set to an instance of an object."}
Then in I'm using a catch for this error, and all is fine.
Do you know a solution for don't use the catch?
Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated
If (TypeOf e.Item Is GridDataItem AndAlso e.Item.IsDataBound) Then
Try
Dim dsDropDown As New DataSet()
OleDbCnn = New Data.OleDb.OleDbConnection(Session("CONNECT_DBS"))
Dim item As GridDataItem = e.Item
Dim list As DropDownList = item.FindControl("DDL_AREA_GEOGRAFICA_NAME")
OleDbSql = Area_Geografica_Code()
Dim OleDbDad As New Data.OleDb.OleDbDataAdapter
OleDbDad = New Data.OleDb.OleDbDataAdapter(OleDbSql, OleDbCnn)
OleDbDad.Fill(dsDropDown)
list.DataSource = dsDropDown
list.DataTextField = "NAME"
list.DataValueField = "CD_CODE"
Catch ex As Exception
ex.Message.ToString()
End Try
End If
End Sub
Thanks for any help
Hello, this is my code for bind a dropdowlist in ItemTemplate that has a Bind("field")
it's work fine, but in Edit Mode one time in
list.DataSource = dsDropDown
give the error:
{"Object reference not set to an instance of an object."}
Then in I'm using a catch for this error, and all is fine.
Do you know a solution for don't use the catch?
Protected Sub RadGrid1_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated
If (TypeOf e.Item Is GridDataItem AndAlso e.Item.IsDataBound) Then
Try
Dim dsDropDown As New DataSet()
OleDbCnn = New Data.OleDb.OleDbConnection(Session("CONNECT_DBS"))
Dim item As GridDataItem = e.Item
Dim list As DropDownList = item.FindControl("DDL_AREA_GEOGRAFICA_NAME")
OleDbSql = Area_Geografica_Code()
Dim OleDbDad As New Data.OleDb.OleDbDataAdapter
OleDbDad = New Data.OleDb.OleDbDataAdapter(OleDbSql, OleDbCnn)
OleDbDad.Fill(dsDropDown)
list.DataSource = dsDropDown
list.DataTextField = "NAME"
list.DataValueField = "CD_CODE"
Catch ex As Exception
ex.Message.ToString()
End Try
End If
End Sub
Thanks for any help