or
<
Item
IsSeparator
=
"True"
/>
<
telerik:RadProgressManager
ID
=
"Radprogressmanager1"
runat
=
"server"
Skin
=
"Office2007"
/>
<
telerik:RadAsyncUpload
runat
=
"server"
ID
=
"AsyncUpload1"
OnClientValidationFailed
=
"validationFailed"
OnClientFileUploadRemoved
=
"fileUploadRemoved"
MultipleFileSelection
=
"Automatic"
EnableInlineProgress
=
"false"
CssClass
=
"RadAsyncUpload"
>
<
Localization
Cancel
=
"Annuleren"
Remove
=
"Verwijderen"
Select
=
"Selecteer"
/>
</
telerik:RadAsyncUpload
>
<
telerik:RadProgressArea
ID
=
"RadProgressArea1"
runat
=
"server"
Culture
=
"nl-NL"
Skin
=
"Office2007"
Style
=
"position: absolute; top: 1%; left: 1%; margin: 0 0 0 0px;"
>
<
Localization
Cancel
=
"Annuleren"
ElapsedTime
=
"Verstreken tijd"
EstimatedTime
=
"Geschatte tijd"
Total
=
"Totaal voortgang"
TotalFiles
=
"Totaal"
TransferSpeed
=
"Snelheid"
Uploaded
=
"Geüpload"
UploadedFiles
=
"Voortgang"
/>
</
telerik:RadProgressArea
>
DataTable dt =
new
DataTable();
for
(
int
i = 0; i < 10; i++)
{
dt.ImportRow(ds.Tables[0].Rows[i]);
dt.AcceptChanges();
}
rgPreview.DataSource = dt;
<
telerik:RadAsyncUpload
runat
=
"server"
ID
=
"RadAsyncUploadImageForNavNode"
AllowedFileExtensions
=
"jpg,jpeg,png,gif"
CssClass
=
"i1nvisible p1ixelWidthHeight"
MaxFileSize
=
"5242880"
MultipleFileSelection
=
"Disabled"
OnFileUploaded
=
"RadAsyncUploadImageForNavNode_FileUploaded"
EnableInlineProgress
=
"false"
MaxFileInputsCount
=
"1"
OnClientFileUploaded
=
"RadAsyncUploadImageForNavNode_OnClientFileUploaded"
Localization-Select="<%$ Resources:PGC, ProjectContentElement_UploadImage %>">
</
telerik:RadAsyncUpload
>
.createContentPageAdditionalOptions .RadUpload input.ruFakeInput
{
display: none;
}
.createContentPageAdditionalOptions .RadUpload input.ruBrowse
{
width: 115px;
}
.createContentPageAdditionalOptions .RadUpload span.ruFileWrap input.ruButtonHover
{
background-position: 100% -46px;
}
.createContentPageAdditionalOptions .RadUpload input.ruButton
{
background-position: 0 -46px;
}
protected
void
Page_Load(
object
sender, EventArgs e)
{
if
(!IsPostBack)
{
AddColumns();
ViewState[
"DataSet"
] = GetData();
}
}
private
void
AddColumns()
{
GridBoundColumn colCustomerID =
new
GridBoundColumn();
GridBoundColumn colBirthDate =
new
GridBoundColumn();
GridBoundColumn colName =
new
GridBoundColumn();
GridBoundColumn colAddress =
new
GridBoundColumn();
GridBoundColumn colPhone =
new
GridBoundColumn();
GridBoundColumn colSalary =
new
GridBoundColumn();
GridBoundColumn colBoolTest =
new
GridBoundColumn();
rgDemo.Columns.Add(colCustomerID);
rgDemo.Columns.Add(colBirthDate);
rgDemo.Columns.Add(colName);
rgDemo.Columns.Add(colAddress);
rgDemo.Columns.Add(colPhone);
rgDemo.Columns.Add(colSalary);
rgDemo.Columns.Add(colBoolTest);
colCustomerID.DataField =
"EmployeeID"
;
colCustomerID.HeaderText =
"EmployeeID"
;
colCustomerID.UniqueName =
"EmployeeID"
;
colBirthDate.DataField =
"BirthDate"
;
colBirthDate.HeaderText =
"BirthDate"
;
colBirthDate.DataType = Type.GetType(
"System.DateTime"
);
colBirthDate.AllowFiltering =
true
;
colBirthDate.UniqueName =
"BirthDate"
;
colBirthDate.DataFormatString =
"{0:MM/dd/yyyy}"
;
colName.DataField =
"Name"
;
colName.HeaderText =
"Name"
;
colName.UniqueName =
"Name"
;
colAddress.DataField =
"Address"
;
colAddress.HeaderText =
"Address"
;
colAddress.UniqueName =
"Address"
;
colPhone.DataField =
"Phone"
;
colPhone.HeaderText =
"Phone"
;
colPhone.UniqueName =
"Phone"
;
colSalary.DataField =
"Salary"
;
colSalary.HeaderText =
"Salary"
;
colSalary.UniqueName =
"Salary"
;
colBoolTest.DataField =
"BoolTest"
;
colBoolTest.HeaderText =
"BoolTest"
;
colBoolTest.DataType =
typeof
(Boolean);
}
private
DataSet GetData()
{
DataSet _dsData =
new
DataSet();
DataTable _dtData =
new
DataTable(
"Employee"
);
DataColumn _dc1 =
new
DataColumn(
"EmployeeID"
,
typeof
(
string
));
DataColumn _dc2 =
new
DataColumn(
"BirthDate"
,
typeof
(DateTime));
DataColumn _dc3 =
new
DataColumn(
"Name"
,
typeof
(
string
));
DataColumn _dc4 =
new
DataColumn(
"Address"
,
typeof
(
string
));
DataColumn _dc5 =
new
DataColumn(
"Phone"
,
typeof
(
string
));
DataColumn _dc6 =
new
DataColumn(
"Salary"
,
typeof
(
int
));
DataColumn _dc7 =
new
DataColumn(
"BoolTest"
,
typeof
(
int
));
_dtData.Columns.Add(_dc1);
_dtData.Columns.Add(_dc3);
_dtData.Columns.Add(_dc2);
_dtData.Columns.Add(_dc4);
_dtData.Columns.Add(_dc5);
_dtData.Columns.Add(_dc6);
_dtData.Columns.Add(_dc7);
for
(
int
i = 0; i < 20; i++)
{
string
index = Convert.ToString(i + 1);
DataRow dr = _dtData.NewRow();
dr[
"EmployeeID"
] =
"E000"
+ index;
dr[
"Name"
] =
"Employee "
+ index;
dr[
"Address"
] =
"Address "
+ index;
dr[
"Phone"
] =
"123-56789"
;
dr[
"Salary"
] = Convert.ToString((i + 1) * 1000);
dr[
"BirthDate"
] = DateTime.Now.AddDays(i + 1);
dr[
"BoolTest"
] = (i % 2) == 0 ?
true
:
false
;
_dtData.Rows.Add(dr);
}
_dsData.Tables.Add(_dtData);
return
_dsData;
}
protected
void
rgDemo_OnNeedDataSource(
object
source, GridNeedDataSourceEventArgs e)
{
//Write code to get data in DataSet ds
DataSet _ds = (DataSet)ViewState[
"DataSet"
];
rgDemo.VirtualItemCount = _ds.Tables[0].Rows.Count;
rgDemo.DataSource = _ds;
}
ctrlRating.ItemCount = NumberOfStars;
The values assigned seem to be automatic (e.g. 1, 2, 3, 4, 5, 6, 7) and I would like to override them with my own values (0, 2, 4, 6, 8, 10, 12).
In this post: http://www.telerik.com/community/forums/aspnet-ajax/rating/tooltips-of-radrating.aspx
you say "That is why, I would recommend that you wrap the rating control in UpdatePanel and update the items in the Items collection server-side."
I have tried to update the items and always get an Index out of range error even in the first iteration.
ctrlRating.Items[numberOfStars - 1].Value = 33
Can you please provide an example of updating the item values using c sharp?
Thanks