Hi
I have looked for a while now but have not come accross the same situation.
I have a grid with one Static Column and then other columns are generated when laoding the Datasource.
I would like to create a Custom Edit Template acording to the data returned for each column as the number of columns can change.
Here is my RadGrid
I have 2 of these grids.
I have defined The dataSource as a Select Query from the database to simplify the Data Transfer to the table.
The one grid's Data is DBType.Bit valueTypes and the other a DBType.Time ValueType.
Here are the data returned by the query
I Would like to create a Yes No Radio Selection for the DBType.Bit grid and RadTimePiker for the DBType.Time Data.
I have found that when the data is in:
- a DBType.Date a datepicker is autogenerated.
- a DBType.Decimal a RadNumericTextbox is autogenerated.
- a DBType.varchar a RadTextbox is autogenerated.
But I need these custom controls.
Is there a way I can create these templates. I edit the items inline.
Thanks in advance
I have looked for a while now but have not come accross the same situation.
I have a grid with one Static Column and then other columns are generated when laoding the Datasource.
I would like to create a Custom Edit Template acording to the data returned for each column as the number of columns can change.
Here is my RadGrid
<
telerik:RadGrid
ID
=
"rgTVMTimes"
runat
=
"server"
GridLines
=
"None"
OnItemCreated
=
"rgCoinBox_ItemCreated"
AllowMultiRowEdit
=
"True"
OnPreRender
=
"rgTVMTimes_PreRender"
OnColumnCreated
=
"rgTVMTimes_ColumnCreated"
OnItemDataBound
=
"rgCoinBox_ItemDataBound"
OnItemCommand
=
"rgCoinBox_ItemCommand"
>
<
MasterTableView
EditMode
=
"InPlace"
CommandItemDisplay
=
"None"
CommandItemStyle-HorizontalAlign
=
"Right"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Heading"
HeaderText
=
""
ItemStyle-BackColor
=
"LightGray"
SortExpression
=
"Heading"
UniqueName
=
"Heading1"
ReadOnly
=
"true"
>
<
filtertemplate
>
<
RadTimePiker
ID
=
"TVMTime"
></
RadTimePiker
>
</
filtertemplate
>
<
ItemStyle
BackColor
=
"LightGray"
/>
</
telerik:GridBoundColumn
>
</
Columns
>
<
RowIndicatorColumn
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
>
<
HeaderStyle
Width
=
"20px"
></
HeaderStyle
>
</
ExpandCollapseColumn
>
<
NoRecordsTemplate
>
<
p
>
No TVM Machines found.
</
p
>
<
p
>
Choose new Location and try again.
</
p
>
</
NoRecordsTemplate
>
<
commanditemstyle
horizontalalign
=
"Right"
/>
</
MasterTableView
>
</
telerik:RadGrid
>
I have defined The dataSource as a Select Query from the database to simplify the Data Transfer to the table.
rgTVMTimes.DataSource =
new
TVMCashUp().GetTvmMachineTimesGrid(_userInfo.StationID,
"TVM Time"
);
rgTVMTimes.DataBind();
rgTVMTimes.Rebind();
rgLogCash.DataSource =
new
TVMCashUp().GetTvmMachineTimesGrid(_userInfo.StationID,
"Log Cash Review"
);
rgLogCash.DataBind();
rgLogCash.Rebind();
public
DataTable GetTvmMachineTimesGrid(
int
inLocationid,
string
grid)
{
return
DataMethods.ReturnMultipleRowResultSet(
"[HO].[GetTvmMachineTimesGrid]"
, inLocationid,grid);
}
Here are the data returned by the query
Heading TVM1 TVM2 TVM3 TVM4 TVM5 TVM6 TVM7
TVM Time 16:10:10 16:10:10 16:10:10 16:10:10 16:10:10 16:10:10 16:10:10
Heading TVM1 TVM2 TVM3 TVM4 TVM5 TVM6 TVM7
Log Cash Review 0 0 0 0 0 0 0
I Would like to create a Yes No Radio Selection for the DBType.Bit grid and RadTimePiker for the DBType.Time Data.
I have found that when the data is in:
- a DBType.Date a datepicker is autogenerated.
- a DBType.Decimal a RadNumericTextbox is autogenerated.
- a DBType.varchar a RadTextbox is autogenerated.
But I need these custom controls.
Is there a way I can create these templates. I edit the items inline.
Thanks in advance