I am attempting to emulate (to some extent) the Cardview sample for the grid. However, there are two differences that I need in my grid compared to the Cardview sample.
First, the grid as I now have displays per the screen capture below named TelerikCardviewQuestion1.gif. As you can see, I have a wide display of an asp:label control that contains long text. Below that I have two lines that contain a user id and a date posted.
The code in the .aspx file that displays this grid is:
<
h5
><
asp:Label
ID
=
"ViewCommentsHdg"
runat
=
"server"
Text
=
"Comments"
Visible
=
"false"
></
asp:Label
></
h5
>
<
telerik:RadGrid
ID
=
"RadGrid2"
runat
=
"server"
AutoGenerateColumns
=
"False"
AllowPaging
=
"True"
Enabled
=
"false"
Visible
=
"false"
GridLines
=
"None"
Width
=
"450px"
EnableEmbeddedSkins
=
"true"
BackColor
=
"#11161D"
Skin
=
"Black"
OnItemCreated
=
"RadGrid2_ItemCreated"
>
<
PagerStyle
Mode
=
"NumericPages"
PageButtonCount
=
"5"
/>
<
PagerStyle
Mode
=
"NumericPages"
AlwaysVisible
=
"true"
></
PagerStyle
>
<
MasterTableView
TableLayout
=
"Fixed"
>
<
ItemTemplate
>
<
asp:Label
ID
=
"Image1"
Text='<%# Eval("TextLangLongBody1") %>' runat="server" />
<
div
>
<
span
style
=
"font-weight: bold;"
></
span
>
<%# Eval("UserUName")%>
<
br
/>
<
span
style
=
"font-weight: bold;"
></
span
>
<%# Format(Eval("TextRunFromDate"), "General Date")%>
<
br
/>
</
div
>
<
br
/>
</
ItemTemplate
>
</
MasterTableView
>
<
ClientSettings
AllowDragToGroup
=
"false"
>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
Dim boundcolumn As GridBoundColumn
boundcolumn = New GridBoundColumn
Me.RadGrid2.Columns.Add(boundcolumn)
boundcolumn.UniqueName = "TextLangLongBody1"
boundcolumn.DataField = "TextLangLongBody1"
boundcolumn.Visible = True
boundcolumn = Nothing
RadGrid2.Enabled = True
RadGrid2.Visible = True
Additonal issues:
(1) I would like the display of the user id and the date posted to be in a separate column from the TextLangLongBody1. I would like these two rows to be displayed as the first column in the grid.
(2) I would like the display of the TextLangLongBody1 to be the second column in the grid.
(3) I have tried moving the asp:Label control down below the <div> containing the user id and date, but all that accomplishes is moving the text below those two fields. It does not create a second column.
Here are my specific questions:
(1) Why does my grid require the Page_Init column definition code to work? This is not required in your Cardview example.
(2) I think I have emulated the Cardview code exactly and yet I only get one column in the grid and not two. Why? Later, in another version of this same grid, I want to add an additional column containing a small display of the user's selected avatar graphic. So I need to resolve this version now so I can build on it later.
I must be missing something really basic, but....?
Thanks in advance for any assistance!
Lynn