or
Dim Item As RadComboBoxItem
For Each row As DataRow In DataTable.Rows
Item = New RadComboBoxItem
Item.Text = row("name").ToString()
Item.Value = row("id").ToString()
Combo.Items.Add(Item)
Next
OR
Combo.DataSource=DataTable
Combo.DataTextField="name"
Combo.DataValueField="id"
Combo.DataBind()
Thanks,
Sanjeev Kumar
protected
void
ListView1_ItemCreated(
object
sender, ListViewItemEventArgs e)
{
if
(e.Item.ItemType == ListViewItemType.DataItem )
{
ListViewDataItem myDataItem = (ListViewDataItem)e.Item;
System.Web.UI.WebControls.DataKey myKey =
this
.ListView1.DataKeys[myDataItem.DisplayIndex];
Decimal rating = (Decimal)ListView1.DataKeys[myDataItem.DisplayIndex][
"Rating"
];
string
id = ListView1.DataKeys[myDataItem.DisplayIndex][
"ID"
].ToString();
RadRating myRad = (RadRating)e.Item.FindControl(
"RadRating1"
);
myRad.Value = rating;
myRad.Attributes[
"GameId"
] = id;
}
}
<
telerik:RadGrid
runat
=
"server"
ID
=
"grid"
AllowPaging
=
"true"
AllowSorting
=
"True"
AllowFilteringByColumn
=
"True"
ShowStatusBar
=
"true"
AutoGenerateColumns
=
"false"
Visible
=
"false"
>
<
ClientSettings
>
<
Selecting
AllowRowSelect
=
"True"
/>
<
ClientEvents
OnRowDblClick
=
"OnRowDblClick"
/>
</
ClientSettings
>
<
PagerStyle
Mode
=
"NumericPages"
Position
=
"Bottom"
/>
<
GroupingSettings
CaseSensitive
=
"false"
/>
<
MasterTableView
ShowHeadersWhenNoRecords
=
"true"
DataKeyNames
=
"Name"
ClientDataKeyNames
=
"Name"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Name"
UniqueName
=
"Name"
HeaderText
=
"Name"
DataType
=
"System.String"
AutoPostBackOnFilter
=
"true"
SortExpression
=
"Name"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"FirstName"
UniqueName
=
"FirstName"
HeaderText
=
"Firstname"
DataType
=
"System.String"
AutoPostBackOnFilter
=
"true"
SortExpression
=
"Firstname"
>
</
telerik:GridBoundColumn
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
UniqueName
=
"Edit"
>
</
telerik:GridEditCommandColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
protected void button_Click(object sender, EventArgs e)
{
DataTable dt;
SqlConnection conn = new SqlConnection();
SqlCommand command = new SqlCommand("fillGrid", cn);
command.CommandType = CommandType.StoredProcedure;
SqlParameter p = new SqlParameter("@param", SqlDbType.NVarChar, 50);
p.Value = var.Text;
command.Parameters.Add(p);
dt = new DataTable();
SqlDataAdapter da = new SqlDataAdapter(cmd);
try
{
conn.Open();
da.Fill(dt);
grid.DataSource = dt;
grid.DataBind();
}
catch ()
{
//...
}
finally
{
if (conn.State != ConnectionState.Closed)
{
conn.Close();
}
}
}
<
style
type
=
"text/css"
>
.modalBackground
{
background-color: Black;
filter: alpha(opacity=90);
opacity: 0.8;
z-index: 0;
}
.modalPopup
{
background-color: #FFFFFF;
border-width: 3px;
border-style: solid;
border-color: black;
padding-top: 10px;
padding-left: 10px;
width: 720px;
height: 260px;
z-index: 1;
}
.modalPopupAdd
{
background-color: #FFFFFF;
border-width: 3px;
border-style: solid;
border-color: black;
padding-top: 10px;
padding-left: 10px;
width: 720px;
height: 360px;
z-index: 1;
}
.radCalendarPopup
{
z-index: 30000 !important;
}
</
style
>
<
ajax:UpdatePanel
ID
=
"UpdatePanel1"
runat
=
"server"
>
<
ContentTemplate
>
<
asp:LinkButton
ID
=
"lnkAdd"
runat
=
"server"
Text
=
"Add Ashram Events"
OnClick
=
"Add"
CssClass
=
"copy"
></
asp:LinkButton
><
br
/>
<
asp:Panel
ID
=
"pnlAddEdit"
runat
=
"server"
CssClass
=
"modalPopup"
Style
=
"display: none"
>
<
table
width
=
"98%"
cellspacing
=
"0"
cellpadding
=
"0"
class
=
"table-border"
id
=
"tblAddEdit"
runat
=
"server"
visible
=
"false"
>
<
tr
>
<
td
>
<
table
width
=
"100%"
border
=
"0"
cellspacing
=
"0"
cellpadding
=
"2"
class
=
"main-content"
>
<
tr
>
<
td
>
<
table
width
=
"100%"
border
=
"1"
cellspacing
=
"0"
cellpadding
=
"2"
>
<
tr
>
<
td
height
=
"25"
colspan
=
"4"
align
=
"center"
class
=
"sub-menu2"
style="padding-left: 10px;
background-color: Yellow">
<
asp:Label
ID
=
"lblHeading"
runat
=
"server"
></
asp:Label
>
</
td
>
</
tr
>
<
tr
style
=
"height: 25px"
>
<
td
colspan
=
"4"
class
=
"sub-menu2"
style
=
"padding-left: 10px; color: #790020; background-color: #f9f9f9"
>
<
u
>Shibir Details</
u
>
</
td
>
</
tr
>
<
tr
style
=
"height: 25px"
>
<
td
class
=
"sub-menu2"
style
=
"padding-left: 10px"
>
<
b
>Shibir Type</
b
> :
</
td
>
<
td
colspan
=
"3"
class
=
"sub-menu2"
style="height: 20px; padding-left: 10px; color: Black;
font-size: 9px; font-family: Verdana, Times New Roman">
<
asp:TextBox
ID
=
"txtShibirType"
runat
=
"server"
Width
=
"300px"
></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
style
=
"height: 25px"
>
<
td
class
=
"sub-menu2"
style
=
"padding-left: 10px"
>
<
b
>From Date</
b
> :
</
td
>
<
td
class
=
"sub-menu2"
style
=
"padding-left: 10px; color: Black;"
>
<
telerik:RadDatePicker
ID
=
"rdpFromDate"
Calendar-Skin
=
"WebBlue"
runat
=
"server"
Width
=
"150px"
DateInput-Enabled
=
"false"
ClientEvents-OnPopupOpening
=
"PopupOpening"
>
<
DatePopupButton
HoverImageUrl
=
"~/RadControls/Calendar/Skins/Sunny/Img/datePickerPopupHover.gif"
ImageUrl
=
"~/RadControls/Calendar/Skins/Sunny/Img/datePickerPopup.gif"
></
DatePopupButton
>
</
telerik:RadDatePicker
>
<
script
type
=
"text/javascript"
>
function PopupOpening(sender, args) {
Telerik.Web.UI.Calendar.Popup.zIndex = 100100;
}
</
script
>
</
td
>
<
td
class
=
"sub-menu2"
style
=
"padding-left: 10px"
>
<
b
>To Date</
b
> :
</
td
>
<
td
class
=
"sub-menu2"
style
=
"padding-left: 10px; color: Black;"
>
<
telerik:RadDatePicker
ID
=
"rdpToDate"
Calendar-Skin
=
"WebBlue"
runat
=
"server"
Width
=
"150px"
DateInput-Enabled
=
"false"
ZIndex
=
"11000"
>
<
DatePopupButton
HoverImageUrl
=
"~/RadControls/Calendar/Skins/Sunny/Img/datePickerPopupHover.gif"
ImageUrl
=
"~/RadControls/Calendar/Skins/Sunny/Img/datePickerPopup.gif"
></
DatePopupButton
>
</
telerik:RadDatePicker
>
</
td
>
</
tr
>
<
tr
style
=
"height: 25px"
>
<
td
class
=
"sub-menu2"
style
=
"padding-left: 10px"
>
<
b
>Location</
b
> :
</
td
>
<
td
class
=
"sub-menu2"
style
=
"padding-left: 10px; color: Black; font-size: 9px; font-family: Verdana, Times New Roman;"
>
<
asp:TextBox
ID
=
"txtLocation"
runat
=
"server"
Width
=
"175px"
></
asp:TextBox
>
</
td
>
<
td
class
=
"sub-menu2"
style
=
"padding-left: 10px"
>
<
b
>Address</
b
> :
</
td
>
<
td
class
=
"sub-menu2"
style
=
"padding-left: 10px; color: Black; font-size: 9px; font-family: Verdana, Times New Roman"
>
<
asp:TextBox
ID
=
"txtAddress"
runat
=
"server"
Width
=
"175px"
></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
style
=
"height: 25px"
>
<
td
class
=
"sub-menu2"
style
=
"padding-left: 10px"
>
<
b
>Shibir Language</
b
> :
</
td
>
<
td
class
=
"sub-menu2"
style
=
"padding-left: 10px; color: Black; font-size: 9px; font-family: Verdana, Times New Roman"
>
<
asp:TextBox
ID
=
"txtShibirLanguage"
runat
=
"server"
Width
=
"175px"
></
asp:TextBox
>
</
td
>
<
td
class
=
"sub-menu2"
style
=
"padding-left: 10px"
>
<
b
>Timings</
b
> :
</
td
>
<
td
class
=
"sub-menu2"
style
=
"padding-left: 10px; color: Black; font-size: 9px; font-family: Verdana, Times New Roman"
>
<
asp:TextBox
ID
=
"txtTimings"
runat
=
"server"
Width
=
"175px"
></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
style
=
"height: 25px"
>
<
td
class
=
"sub-menu2"
style
=
"padding-left: 10px"
>
<
b
>Last Date of Registration</
b
> :
</
td
>
<
td
colspan
=
"3"
height
=
"40"
class
=
"sub-menu2"
style
=
"padding-left: 10px; color: Black;"
>
<
telerik:RadDatePicker
ID
=
"rdpRegistrationLastDate"
Calendar-Skin
=
"WebBlue"
runat
=
"server"
Width
=
"150px"
DateInput-Enabled
=
"false"
ZIndex
=
"11000"
>
<
DatePopupButton
HoverImageUrl
=
"~/RadControls/Calendar/Skins/Sunny/Img/datePickerPopupHover.gif"
ImageUrl
=
"~/RadControls/Calendar/Skins/Sunny/Img/datePickerPopup.gif"
></
DatePopupButton
>
</
telerik:RadDatePicker
>
</
td
>
</
tr
>
<
tr
style
=
"height: 25px"
>
<
td
colspan
=
"4"
class
=
"sub-menu2"
style
=
"padding-left: 10px; color: #790020; background-color: #f9f9f9"
>
<
u
>Other Details</
u
>
</
td
>
</
tr
>
<
tr
style
=
"height: 25px"
>
<
td
class
=
"sub-menu2"
style
=
"padding-left: 10px"
>
<
b
>Contact Person</
b
> :
</
td
>
<
td
class
=
"sub-menu2"
style
=
"padding-left: 10px; color: Black; font-size: 9px; font-family: Verdana, Times New Roman"
>
<
asp:TextBox
ID
=
"txtContactPerson"
runat
=
"server"
Width
=
"175px"
></
asp:TextBox
>
</
td
>
<
td
class
=
"sub-menu2"
style
=
"padding-left: 10px"
>
<
b
>Contact Details</
b
> :
</
td
>
<
td
class
=
"sub-menu2"
style
=
"padding-left: 10px; color: Black; font-size: 9px; font-family: Verdana, Times New Roman"
>
<
asp:TextBox
ID
=
"txtContactDetails"
runat
=
"server"
Width
=
"175px"
></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
style
=
"height: 25px"
>
<
td
class
=
"sub-menu2"
style
=
"padding-left: 10px"
>
<
b
>Other Details</
b
> :
</
td
>
<
td
colspan
=
"3"
height
=
"40"
class
=
"sub-menu2"
style="padding-left: 10px; color: Black;
font-size: 9px; font-family: Verdana, Times New Roman">
<
asp:TextBox
ID
=
"txtOtherDetails"
runat
=
"server"
Width
=
"450px"
TextMode
=
"MultiLine"
></
asp:TextBox
>
</
td
>
</
tr
>
<
tr
>
<
td
colspan
=
"4"
align
=
"center"
>
<
asp:Button
ID
=
"btnSave"
runat
=
"server"
Text
=
"Save"
/>
<
asp:Button
ID
=
"btnCancel"
runat
=
"server"
Text
=
"Cancel"
OnClientClick
=
"return Hidepopup()"
/>
</
td
>
</
tr
>
</
table
>
</
td
>
</
tr
>
</
table
>
</
td
>
</
tr
>
</
table
>
</
asp:Panel
>
<
asp:LinkButton
ID
=
"lnkFake"
runat
=
"server"
></
asp:LinkButton
>
<
ajaxToolkit:ModalPopupExtender
ID
=
"popup"
runat
=
"server"
DropShadow
=
"false"
PopupControlID
=
"pnlAddEdit"
TargetControlID
=
"lnkFake"
BackgroundCssClass
=
"modalBackground"
>
</
ajaxToolkit:ModalPopupExtender
>
</
ContentTemplate
>
<
Triggers
>
<
ajax:AsyncPostBackTrigger
ControlID
=
"dgAshramEvents"
/>
<
ajax:AsyncPostBackTrigger
ControlID
=
"btnSave"
/>
</
Triggers
>
</
ajax:UpdatePanel
>
<
telerik:RadListBox CheckBoxes="true"> On check of Checkbox I want enble and disable the buttons. I need to catch the checkbox click event at the server side. How can I implement this?
Regards,
Medac