I have a hierarchical radgrid that is displaying "No child records to display" even when records exist. See attached photo. Below is my RadGrid definition:
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
ShowStatusBar
=
"true"
AutoGenerateColumns
=
"False"
AllowSorting
=
"True"
OnDetailTableDataBind
=
"RadGrid1_DetailTableDataBind"
OnNeedDataSource
=
"RadGrid1_NeedDataSource"
OnPreRender
=
"RadGrid1_PreRender"
GroupPanelPosition
=
"Top"
OnBatchEditCommand
=
"RadGrid1_BatchEditCommand"
Skin
=
"Office2010Black"
AllowFilteringByColumn
=
"True"
CellSpacing
=
"-1"
GridLines
=
"Both"
Visible
=
"false"
>
<
MasterTableView
DataKeyNames
=
"wbs_id"
RetainExpandStateOnRebind
=
"True"
AllowMultiColumnSorting
=
"True"
CommandItemDisplay
=
"Top"
>
<
DetailTables
>
<
telerik:GridTableView
runat
=
"server"
Width
=
"100%"
DataKeyNames
=
"task_id"
RetainExpandStateOnRebind
=
"True"
Name
=
"Steps"
>
<
CommandItemSettings
ShowAddNewRecordButton
=
"False"
></
CommandItemSettings
>
</
telerik:GridTableView
>
<
telerik:GridTableView
runat
=
"server"
Width
=
"100%"
DataKeyNames
=
"task_id"
RetainExpandStateOnRebind
=
"True"
Name
=
"Steps"
>
<
DetailTables
>
<
telerik:GridTableView
runat
=
"server"
Width
=
"100%"
DataKeyNames
=
"task_id"
RetainExpandStateOnRebind
=
"True"
EditMode
=
"Batch"
Name
=
"StepDetails"
CommandItemDisplay
=
"Top"
>
</
telerik:GridTableView
>
</
DetailTables
>
</
telerik:GridTableView
>
</
DetailTables
>
<
CommandItemSettings
ShowAddNewRecordButton
=
"False"
></
CommandItemSettings
>
</
MasterTableView
>
<
PagerStyle
Mode
=
"NumericPages"
></
PagerStyle
>
<
MasterTableView
DataKeyNames
=
"wbs_id"
AllowMultiColumnSorting
=
"True"
CommandItemDisplay
=
"Top"
RetainExpandStateOnRebind
=
"true"
>
<
CommandItemSettings
ShowAddNewRecordButton
=
"false"
ShowRefreshButton
=
"true"
></
CommandItemSettings
>
<
DetailTables
>
<
telerik:GridTableView
DataKeyNames
=
"task_id"
Name
=
"Steps"
Width
=
"100%"
RetainExpandStateOnRebind
=
"true"
>
<
DetailTables
>
<
telerik:GridTableView
DataKeyNames
=
"task_id"
Name
=
"StepDetails"
Width
=
"100%"
EditMode
=
"Batch"
CommandItemDisplay
=
"Top"
RetainExpandStateOnRebind
=
"true"
>
<
CommandItemSettings
ShowSaveChangesButton
=
"true"
ShowCancelChangesButton
=
"true"
ShowAddNewRecordButton
=
"false"
/>
<
Columns
>
<
telerik:GridBoundColumn
SortExpression
=
"proc_id"
HeaderText
=
"proc id"
HeaderButtonType
=
"TextButton"
DataField
=
"proc_id"
Display
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"proc_name"
HeaderText
=
"Step Name"
HeaderButtonType
=
"TextButton"
DataField
=
"proc_name"
ReadOnly
=
"true"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"proc_wt"
HeaderText
=
"Step Weight"
HeaderButtonType
=
"TextButton"
DataField
=
"proc_wt"
ReadOnly
=
"true"
AllowFiltering
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"complete_pct"
HeaderText
=
"Percent Complete"
HeaderButtonType
=
"TextButton"
DataField
=
"complete_pct"
ReadOnly
=
"true"
AllowFiltering
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"CompleteFlag"
DataField
=
"complete_flag"
HeaderText
=
"Complete"
ReadOnly
=
"true"
AllowFiltering
=
"false"
>
<
ItemTemplate
>
<
asp:CheckBox
ID
=
"CheckBox1"
runat
=
"server"
Checked='<%#DataBinder.Eval (Container.DataItem,"complete_flag").ToString()!="N"? true:false %>' />
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridDateTimeColumn
MinDate
=
"2013-01-01"
DataField
=
"act_start"
HeaderText
=
"Actual Start"
SortExpression
=
"act_start"
UniqueName
=
"act_start"
DataType
=
"System.DateTime"
FilterControlAltText
=
"Filter act_start column"
DataFormatString
=
"{0:yyyy/MM/dd}"
ItemStyle-BackColor
=
"#c6f3ff"
AllowFiltering
=
"false"
>
</
telerik:GridDateTimeColumn
>
<
telerik:GridDateTimeColumn
MinDate
=
"2013-01-01"
DataField
=
"est_act_finish"
HeaderText
=
"Est/Actual Finish"
SortExpression
=
"est_act_finish"
UniqueName
=
"est_act_finish"
DataType
=
"System.DateTime"
FilterControlAltText
=
"Filter est_act_finish column"
DataFormatString
=
"{0:yyyy/MM/dd}"
ItemStyle-BackColor
=
"#c6f3ff"
AllowFiltering
=
"false"
>
</
telerik:GridDateTimeColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"complete_pct_upd"
HeaderText
=
"Updated Percent Complete"
HeaderButtonType
=
"TextButton"
DataField
=
"complete_pct_upd"
DataType
=
"System.Decimal"
ItemStyle-BackColor
=
"#c6f3ff"
AllowFiltering
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"last_updated"
HeaderText
=
"Last Updated"
HeaderButtonType
=
"TextButton"
DataField
=
"last_updated"
ReadOnly
=
"true"
DataType
=
"System.DateTime"
DataFormatString
=
"{0:yyyy/MM/dd}"
AllowFiltering
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"updated_by"
HeaderText
=
"Updated By"
HeaderButtonType
=
"TextButton"
DataField
=
"updated_by"
ReadOnly
=
"true"
AllowFiltering
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"comments"
HeaderText
=
"Comments"
HeaderButtonType
=
"TextButton"
DataField
=
"comments"
ReadOnly
=
"false"
DataType
=
"System.String"
AllowFiltering
=
"false"
ItemStyle-BackColor
=
"#c6f3ff"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
telerik:GridTableView
>
</
DetailTables
>
<
Columns
>
<
telerik:GridBoundColumn
SortExpression
=
"task_id"
HeaderText
=
"task_id"
HeaderButtonType
=
"TextButton"
DataField
=
"task_id"
Display
=
"false"
ReadOnly
=
"true"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"task_code"
HeaderText
=
"Activity ID"
HeaderButtonType
=
"TextButton"
DataField
=
"task_code"
UniqueName
=
"task_code"
ReadOnly
=
"true"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"task_name"
HeaderText
=
"Activity Name"
HeaderButtonType
=
"TextButton"
DataField
=
"task_name"
UniqueName
=
"task_name"
ReadOnly
=
"true"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"start"
HeaderText
=
"Start"
HeaderButtonType
=
"TextButton"
DataField
=
"start"
UniqueName
=
"start"
DataType
=
"System.DateTime"
ReadOnly
=
"true"
DataFormatString
=
"{0:yyyy/MM/dd}"
AllowFiltering
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"finish"
HeaderText
=
"Finish"
HeaderButtonType
=
"TextButton"
DataField
=
"finish"
UniqueName
=
"finish"
DataType
=
"System.DateTime"
ReadOnly
=
"true"
DataFormatString
=
"{0:yyyy/MM/dd}"
AllowFiltering
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"remain_work_qty"
EmptyDataText
=
""
HeaderText
=
"Remaining Hours"
SortExpression
=
"remain_work_qty"
UniqueName
=
"remain_work_qty"
DataType
=
"System.Decimal"
ReadOnly
=
"true"
AllowFiltering
=
"false"
DataFormatString
=
"{0:0}"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
telerik:GridTableView
>
</
DetailTables
>
<
Columns
>
<
telerik:GridBoundColumn
SortExpression
=
"wbs_id"
HeaderText
=
"wbs_id"
HeaderButtonType
=
"TextButton"
DataField
=
"wbs_id"
Display
=
"false"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
SortExpression
=
"wbs_name"
HeaderText
=
"Work Package"
HeaderButtonType
=
"TextButton"
DataField
=
"wbs_name"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
This is how it is being bound:
protected
void
RadGrid1_NeedDataSource(
object
sender, GridNeedDataSourceEventArgs e)
{
if
(RadComboBox1.SelectedIndex != -1 && RadDropDownList1.SelectedIndex != -1)
{
string
projid = RadDropDownList1.SelectedValue;
string
cam = RadComboBox1.SelectedValue;
if
(!e.IsFromDetailTable)
{
RadGrid1.DataSource = GetDataTable(
"SELECT * FROM PrimaveraWbs WHERE proj_id = "
+ projid +
" and name = '"
+ cam +
"'"
);
}
}
}
public
DataTable GetDataTable(
string
query)
{
String ConnString = ConfigurationManager.ConnectionStrings[
"PSMSystemConnectionString"
].ConnectionString;
SqlConnection conn =
new
SqlConnection(ConnString);
SqlDataAdapter adapter =
new
SqlDataAdapter();
adapter.SelectCommand =
new
SqlCommand(query, conn);
DataTable myDataTable =
new
DataTable();
conn.Open();
try
{
adapter.Fill(myDataTable);
}
finally
{
conn.Close();
}
return
myDataTable;
}
protected
void
RadGrid1_DetailTableDataBind(
object
source, Telerik.Web.UI.GridDetailTableDataBindEventArgs e)
{
GridDataItem dataItem = (GridDataItem)e.DetailTableView.ParentItem;
switch
(e.DetailTableView.Name)
{
case
"Steps"
:
{
string
wbs_id = dataItem.GetDataKeyValue(
"wbs_id"
).ToString();
e.DetailTableView.DataSource = GetDataTable(
"SELECT * FROM PrimaveraTask WHERE wbs_id = "
+ wbs_id +
" ORDER BY task_code"
);
break
;
}
case
"StepDetails"
:
{
string
task_id = dataItem.GetDataKeyValue(
"task_id"
).ToString();
e.DetailTableView.DataSource = GetDataTable(
"SELECT * FROM PrimaveraSteps WHERE task_id = "
+ task_id +
""
);
break
;
}
}
}
protected
void
RadGrid1_PreRender(
object
sender, EventArgs e)
{
string
acb = RadDropDownList1.SelectedText;
if
(RadComboBox1 !=
null
&& RadDropDownList1.SelectedIndex != -1)
{
if
(!Page.IsPostBack)
{
RadGrid1.MasterTableView.Items[0].Expanded =
true
;
RadGrid1.MasterTableView.Items[0].ChildItem.NestedTableViews[0].Items[0].Expanded =
true
;
}
}
}
How do I ensure that this message is not displayed when records do exist?
Thanks in advance,
Josh
Please double check your online demo pages, e.g. http://demos.telerik.com/aspnet-ajax/imageeditor/examples/overview/defaultcs.aspx
Try to open the Crop dialog (in IE11):
SCRIPT5022: Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
Details: Error parsing near 'HwdlHwoCAh8LaB8MaGRk'.
File: Telerik.Web.UI.WebResource.axd, Line: 15, Column: 16485
I have a RadDropDownTree. I populate it with a hierarchy from the database. I set the "SelectedValue" equal to whatever group an employee belongs to (based on database record).
So for example: DropDownTree loads and selects "bakery" based on it's ID in the db.
Store
-->cashier
-->bakery (selected)
-->maintenance
So now I click on "cashier" and hit update. On the server side, the DropDownTree.SelectedValue is still equal to the ID of the "bakery". Why is the change not being sent to the server side?
<asp:ObjectDataSource ID="ObjectDataSource1" TypeName="MyNameSpace.DataAccessLayer.UserDataObject" |
SelectMethod="Select" SelectCountMethod="SelectCount" EnablePaging="True" runat="server" |
MaximumRowsParameterName="maximumRow" OldValuesParameterFormatString="original_{0}" |
OnSelecting="ObjectDataSource1_Selecting" OnSelected="ObjectDataSource1_Selected"> |
<SelectParameters> |
<asp:Parameter Name="shopID" Type="Int32" /> |
<asp:Parameter Name="filter" Type="String" /> |
<asp:Parameter Name="sort" Type="Object" /> |
<asp:Parameter Name="startRowIndex" Type="Int32" /> |
<asp:Parameter Name="maximumRow" Type="Int32" /> |
</SelectParameters> |
</asp:ObjectDataSource> |
protected void ObjectDataSource1_Selecting(object sender, ObjectDataSourceSelectingEventArgs e) |
{ |
e.InputParameters["shopID"] = thisShop.ShopID; |
e.InputParameters["filter"] = RadGrid1.MasterTableView.FilterExpression; |
e.InputParameters["sort"] = RadGrid1.MasterTableView.SortExpressions.GetSortString(); |
e.InputParameters["startRowIndex"] = RadGrid1.CurrentPageIndex*RadGrid1.PageSize; |
e.InputParameters["maximumRow"] = RadGrid1.PageSize; |
} |
Already I implemented custom sorting and custom paging with objectdatasource and database. Now I need to implement custom filtering in rad grid with objectdatasource and database.
Can you send me any sample solution?
hi,
i bind hmtlchart from dataset i want to display just the datetime wich is into dataset but in displaying it's apear an interval of datetime
in this pics you wille understanding me more and i use gridview to disply the data are in dataset plz help me i'm working in project and i need help quickly