As attach Image, please help me to display name replace Id when group by foreign key. thanks
3 Answers, 1 is accepted
0

Jayesh Goyani
Top achievements
Rank 2
answered on 22 Feb 2013, 01:49 PM
Hello,
I am not able to reproduce this issue.
Please check below code and screenshot.



Note : Please try with below code snippet. if you are not able to resolved this issue then please elaborate your scenario or provide your code.
Thanks,
Jayesh Goyani
I am not able to reproduce this issue.
Please check below code and screenshot.
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
DataSourceID
=
"SqlDataSource1"
>
<
MasterTableView
AutoGenerateColumns
=
"False"
DataKeyNames
=
"StudentID"
DataSourceID
=
"SqlDataSource1"
>
<
GroupByExpressions
>
<
telerik:GridGroupByExpression
>
<
SelectFields
>
<
telerik:GridGroupByField
FieldAlias
=
"AcademyName"
FieldName
=
"AcademyName"
></
telerik:GridGroupByField
>
</
SelectFields
>
<
GroupByFields
>
<
telerik:GridGroupByField
FieldName
=
"AcademyName"
SortOrder
=
"Ascending"
></
telerik:GridGroupByField
>
</
GroupByFields
>
</
telerik:GridGroupByExpression
>
</
GroupByExpressions
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
></
CommandItemSettings
>
<
RowIndicatorColumn
Visible
=
"True"
FilterControlAltText
=
"Filter RowIndicator column"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
Visible
=
"True"
FilterControlAltText
=
"Filter ExpandColumn column"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"StudentID"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter StudentID column"
HeaderText
=
"StudentID"
ReadOnly
=
"True"
SortExpression
=
"StudentID"
UniqueName
=
"StudentID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"StudentName"
FilterControlAltText
=
"Filter StudentName column"
HeaderText
=
"StudentName"
SortExpression
=
"StudentName"
UniqueName
=
"StudentName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"AcademyName"
FilterControlAltText
=
"Filter AcademyName column"
HeaderText
=
"AcademyName"
SortExpression
=
"AcademyName"
UniqueName
=
"AcademyName"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
>
</
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
<
FilterMenu
EnableImageSprites
=
"False"
>
</
FilterMenu
>
</
telerik:RadGrid
>
<
asp:SqlDataSource
ID
=
"SqlDataSource1"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:JayeshTestConnectionString %>"
SelectCommand="SELECT StudentDetails.StudentID, StudentDetails.StudentName, AcademyDetail.AcademyName, AcademyDetail.AcademyID FROM StudentDetails INNER JOIN AcademyDetail ON AcademyDetail.StudentID = StudentDetails.StudentID">
</
asp:SqlDataSource
>
Note : Please try with below code snippet. if you are not able to resolved this issue then please elaborate your scenario or provide your code.
Thanks,
Jayesh Goyani
0

Trung Lee
Top achievements
Rank 2
answered on 23 Feb 2013, 01:55 AM
Thanks for your fast reply.
-As same as your example, but i want to group by StudentName and display StudentName on that Groupby, how to do that? Because Student as a foreign key of Academy, and it will display StudentID instead of StudentName.
Thanks Jayesh Goyani very much!
-As same as your example, but i want to group by StudentName and display StudentName on that Groupby, how to do that? Because Student as a foreign key of Academy, and it will display StudentID instead of StudentName.
Thanks Jayesh Goyani very much!
0

Jayesh Goyani
Top achievements
Rank 2
answered on 25 Feb 2013, 05:41 AM
Hello,

Sorry but still i am not able to reproduce this issue. (DLL version : 2012.3.1016.40)
If possible than can you please provide your code.
Thanks,
Jayesh Goyani
<
MasterTableView
AutoGenerateColumns
=
"False"
DataKeyNames
=
"StudentID"
DataSourceID
=
"SqlDataSource1"
>
<
GroupByExpressions
>
<
telerik:GridGroupByExpression
>
<
SelectFields
>
<
telerik:GridGroupByField
FieldAlias
=
"StudentName"
FieldName
=
"StudentName"
></
telerik:GridGroupByField
>
</
SelectFields
>
<
GroupByFields
>
<
telerik:GridGroupByField
FieldName
=
"StudentName"
SortOrder
=
"Ascending"
></
telerik:GridGroupByField
>
</
GroupByFields
>
</
telerik:GridGroupByExpression
>
</
GroupByExpressions
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
></
CommandItemSettings
>
<
RowIndicatorColumn
Visible
=
"True"
FilterControlAltText
=
"Filter RowIndicator column"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
Visible
=
"True"
FilterControlAltText
=
"Filter ExpandColumn column"
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"StudentName"
FilterControlAltText
=
"Filter StudentName column"
HeaderText
=
"StudentName"
SortExpression
=
"StudentName"
UniqueName
=
"StudentName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"AcademyName"
FilterControlAltText
=
"Filter AcademyName column"
HeaderText
=
"AcademyName"
SortExpression
=
"AcademyName"
UniqueName
=
"AcademyName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"AcademyID"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter AcademyID column"
HeaderText
=
"AcademyID"
ReadOnly
=
"True"
SortExpression
=
"AcademyID"
UniqueName
=
"AcademyID"
>
</
telerik:GridBoundColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
>
</
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
Sorry but still i am not able to reproduce this issue. (DLL version : 2012.3.1016.40)
If possible than can you please provide your code.
Thanks,
Jayesh Goyani