<
telerik:RadListView
ID
=
"RadListView2"
runat
=
"server"
AllowPaging
=
"True"
ItemPlaceholderID
=
"ListPlaceHolder"
Skin
=
"listview_2"
EnableEmbeddedSkins
=
"false"
DataKeyNames
=
"id,filenameextension,typeAbbr,title"
OnNeedDataSource
=
"RadListView2_NeedDataSource"
>
<
LayoutTemplate
>
<
table
id
=
"products"
class
=
"products"
>
<
thead
>
<
tr
>
<
th
>
Prev
</
th
>
<
th
class
=
"expand"
>
</
th
>
<
th
>
File Name
</
th
>
<
th
>
Asset Type
</
th
>
<
th
>
Document Type
</
th
>
<
th
>
Advertiser Name
</
th
>
<
th
>
Advertiser Category
</
th
>
<
th
>
Details
</
th
>
<
th
>
Market
</
th
>
<
th
>
Product Category
</
th
>
<
th
>
Keywords
</
th
>
<
th
>
Approved
</
th
>
<
th
>
Date
</
th
>
</
tr
>
</
thead
>
<
tbody
>
<
tr
id
=
"ListPlaceHolder"
runat
=
"server"
>
</
tr
>
</
tbody
>
</
table
>
</
LayoutTemplate
>
<
ItemTemplate
>
<
tr
>
<
td
>
<%# String.Format("javascript:Popup_Window('asset_preview', '{0}');", Eval("id").ToString())%>
</
td
>
<
td
>
<
asp:CheckBox
ID
=
"ChkImage2"
runat
=
"server"
Style
=
"float: left; padding-top: 5px"
/>
</
td
>
<
td
>
<%# String.Format("javascript:Popup_Window('asset_detail', '{0}');", Eval("id").ToString())%>
</
td
>
<
td
>
<%# Eval("typeAbbr")%>
</
td
>
<
td
>
<%# Eval("documentTypeText")%>
</
td
>
</
tr
>
</
ItemTemplate
>
<
EmptyDataTemplate
>
No Assets Found 2
</
EmptyDataTemplate
>
</
telerik:RadListView
>
<
tk:RadGrid
ID
=
"rgThreshold"
runat
=
"server"
AllowPaging
=
"True"
Width
=
"100%"
PageSize
=
"10"
Skin
=
"Black"
OnInsertCommand
=
"rgThreshold_InsertCommand"
OnDeleteCommand
=
"rgThreshold_DeleteCommand"
OnUpdateCommand
=
"rgThreshold_UpdateCommand"
AutoGenerateColumns
=
"False"
AllowSorting
=
"True"
CellSpacing
=
"0"
OnNeedDataSource
=
"rgThreshold_NeedDataSource"
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
/>
<
ValidationSettings
EnableValidation
=
"true"
EnableModelValidation
=
"true"
CommandsToValidate
=
"Insert,Edit"
/>
<
MasterTableView
CommandItemDisplay
=
"Top"
EditMode
=
"EditForms"
InsertItemDisplay
=
"Top"
AutoGenerateColumns
=
"false"
DataKeyNames
=
"ThresholdID"
EditFormSettings-EditColumn-ButtonType
=
"ImageButton"
>
<
CommandItemSettings
AddNewRecordText
=
"Add New Threshold"
/>
<
Columns
>
<
tk:GridEditCommandColumn
UniqueName
=
"EditCommandColumn"
ButtonType
=
"ImageButton"
>
<
ItemStyle
CssClass
=
"myImageButton"
/>
</
tk:GridEditCommandColumn
>
<
tk:GridBoundColumn
HeaderText
=
"Threshold ID"
DataField
=
"ThresholdID"
Display
=
"false"
UniqueName
=
"ThresholdID"
ReadOnly
=
"true"
/>
<
tk:GridTemplateColumn
HeaderText
=
"Threshold Number"
DataField
=
"ThresholdNumber"
UniqueName
=
"ThresholdNumber"
SortExpression
=
"ThresholdNumber"
ColumnEditorID
=
"ThresholdNumberEditor"
HeaderStyle-Width
=
"150px"
>
<
ItemTemplate
>
<%# Eval("ThresholdNumber") %>
</
ItemTemplate
>
<
InsertItemTemplate
>
<
tk:RadNumericTextBox
ID
=
"tbThresholdNumber"
runat
=
"server"
Value
=
"5"
DbValue='<%# Bind("ThresholdNumber") %>' Width="50px" ShowSpinButtons="true" NumberFormat-DecimalDigits="0" />
<
asp:RequiredFieldValidator
ID
=
"rfvThresholdNumber"
runat
=
"server"
ControlToValidate
=
"tbThresholdNumber"
Text
=
"Threshold Number is Required."
InitialValue
=
""
Display
=
"Dynamic"
CssClass
=
"Validator"
/>
</
InsertItemTemplate
>
<
EditItemTemplate
>
<
tk:RadNumericTextBox
ID
=
"tbThresholdNumber"
runat
=
"server"
DbValue='<%# Bind("ThresholdNumber") %>' Width="50px" ShowSpinButtons="true" NumberFormat-DecimalDigits="0" />
<
asp:RequiredFieldValidator
ID
=
"rfvThresholdNumber"
runat
=
"server"
ControlToValidate
=
"tbThresholdNumber"
Text
=
"Threshold Number is Required."
InitialValue
=
""
Display
=
"Dynamic"
CssClass
=
"Validator"
/>
</
EditItemTemplate
>
</
tk:GridTemplateColumn
>
<
tk:GridTemplateColumn
HeaderText
=
"Threshold Name"
DataField
=
"ThresholdName"
UniqueName
=
"ThresholdName"
ColumnEditorID
=
"ThresholdNameEditor"
HeaderStyle-Width
=
"300px"
>
<
ItemTemplate
>
<%# Eval("ThresholdName") %>
</
ItemTemplate
>
<
InsertItemTemplate
>
<
tk:RadTextBox
ID
=
"tbThresholdName"
runat
=
"server"
Text='<%# Bind("ThresholdName") %>' Width="500px" MaxLength="100" />
<
asp:RequiredFieldValidator
ID
=
"rfvThresholdName"
runat
=
"server"
ControlToValidate
=
"tbThresholdName"
Text
=
"Threshold Name is Required."
InitialValue
=
""
Display
=
"Dynamic"
CssClass
=
"Validator"
/>
</
InsertItemTemplate
>
<
EditItemTemplate
>
<
tk:RadTextBox
ID
=
"tbThresholdName"
runat
=
"server"
Text='<%# Bind("ThresholdName") %>' Width="500px" MaxLength="100" />
<
asp:RequiredFieldValidator
ID
=
"rfvThresholdName"
runat
=
"server"
ControlToValidate
=
"tbThresholdName"
Text
=
"Threshold Name is Required."
InitialValue
=
""
Display
=
"Dynamic"
CssClass
=
"Validator"
/>
</
EditItemTemplate
>
</
tk:GridTemplateColumn
>
<
tk:GridTemplateColumn
HeaderText
=
"Emails"
DataField
=
"Emails"
UniqueName
=
"Emails"
ColumnEditorID
=
"EmailsEditor"
HeaderStyle-Width
=
"400px"
>
<
ItemTemplate
>
<%# Eval("Emails") %>
</
ItemTemplate
>
<
InsertItemTemplate
>
<
tk:RadTextBox
ID
=
"tbEmails"
runat
=
"server"
Text='<%# Bind("Emails") %>' TextMode="MultiLine" Width="500px" Height="100px" MaxLength="2000" />
<
asp:RequiredFieldValidator
ID
=
"rfvEmails"
runat
=
"server"
ControlToValidate
=
"tbEmails"
Text
=
"Emails are Required."
InitialValue
=
""
Display
=
"Dynamic"
CssClass
=
"Validator"
/>
</
InsertItemTemplate
>
<
EditItemTemplate
>
<
tk:RadTextBox
ID
=
"tbEmails"
runat
=
"server"
Text='<%# Bind("Emails") %>' TextMode="MultiLine" Width="500px" Height="100px" MaxLength="2000" />
<
asp:RequiredFieldValidator
ID
=
"rfvEmails"
runat
=
"server"
ControlToValidate
=
"tbEmails"
Text
=
"Emails are Required."
InitialValue
=
""
Display
=
"Dynamic"
CssClass
=
"Validator"
/>
</
EditItemTemplate
>
</
tk:GridTemplateColumn
>
<
tk:GridTemplateColumn
HeaderText
=
"CC Emails"
DataField
=
"AdminEmails"
UniqueName
=
"AdminEmails"
ColumnEditorID
=
"AdminEmailsEditor"
HeaderStyle-Width
=
"400px"
>
<
ItemTemplate
>
<%# Eval("AdminEmails") %>
</
ItemTemplate
>
<
InsertItemTemplate
>
<
tk:RadTextBox
ID
=
"tbAdminEmails"
runat
=
"server"
Text='<%# Bind("AdminEmails") %>' TextMode="MultiLine" Width="500px" Height="100px" MaxLength="2000" />
</
InsertItemTemplate
>
<
EditItemTemplate
>
<
tk:RadTextBox
ID
=
"tbAdminEmails"
runat
=
"server"
Text='<%# Bind("AdminEmails") %>' TextMode="MultiLine" Width="500px" Height="100px" MaxLength="2000" />
</
EditItemTemplate
>
</
tk:GridTemplateColumn
>
<
tk:GridButtonColumn
ConfirmText
=
"Delete this Threshold (All Assignments will also be deleted)?"
ConfirmDialogType
=
"RadWindow"
ConfirmTitle
=
"Delete Threshold"
CommandArgument
=
"ThresholdID"
CommandName
=
"Delete"
ConfirmDialogHeight
=
"100px"
ConfirmDialogWidth
=
"220px"
ButtonType
=
"ImageButton"
/>
</
Columns
>
<
EditFormSettings
ColumnNumber
=
"2"
CaptionDataField
=
"ThresholdName"
CaptionFormatString
=
"Edit: {0}"
>
<
FormCaptionStyle
CssClass
=
"EditFormHeader"
></
FormCaptionStyle
>
</
EditFormSettings
>
</
MasterTableView
>
</
tk:RadGrid
>
<
tk:RadWindowManager
ID
=
"RadWindowManager1"
runat
=
"server"
Skin
=
"Black"
/>
<
tk:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
Skin
=
"Black"
/>
Hi,
I am binding the radgrid using normal datasource and databind method.
the grid is getting filled with autogenerated columns. I have placed one checkbox which is in the grid, not auto generated.
Now, on post back usong any button in the page. the data in the viewstate also gets loaded. this creates addtional column. I did
radgrid.MasterTableView.Columns.Clear();
the reaction is, this will also remove the checkbox in the item template. I am not sure on how to add check box and header text box in the item template in radgrid programmatically. the example given in telerik site is not helpful.
http://www.telerik.com/help/aspnet-ajax/grid-programmatic-creation.html
I requrie a solution, on how to added a column which checkbox programmatically or
running this without touching template column or
prevent viewstate from acting on button postbacks.
thanks in advance.