[ID] [int]
[ParentID] [int]
[OrderID] [int]
[Title] [ntext]
[Start] [datetime]
[End] [datetime]
[PercentComplete] [decimal]
[Summary] [bit]
<
telerik:RadGantt
runat
=
"server"
ID
=
"GanttChart"
Skin
=
"Silk"
ListWidth
=
"400px"
Height
=
"350px"
Width
=
"1000px"
SelectedView
=
"WeekView"
AutoGenerateColumns
=
"false"
WorkWeekStart
=
"Monday"
WorkWeekEnd
=
"Friday"
>
<
Columns
>
<
telerik:GanttBoundColumn
DataField
=
"Title"
HeaderText
=
"Attivita"
DataType
=
"String"
UniqueName
=
"Title"
Width
=
"150px"
AllowEdit
=
"false"
></
telerik:GanttBoundColumn
>
<
telerik:GanttBoundColumn
DataField
=
"Start"
HeaderText
=
"Inizio"
DataType
=
"DateTime"
UniqueName
=
"Start"
DataFormatString
=
"dd/MM/yy"
Width
=
"65px"
AllowEdit
=
"false"
/>
<
telerik:GanttBoundColumn
DataField
=
"End"
HeaderText
=
"Fine"
DataType
=
"DateTime"
UniqueName
=
"End"
DataFormatString
=
"dd/MM/yy"
Width
=
"65px"
AllowEdit
=
"false"
/>
<
telerik:GanttBoundColumn
DataField
=
"PercentComplete"
HeaderText
=
"Completamento"
DataType
=
"Number"
UniqueName
=
"PercentComplete"
Width
=
"110px"
AllowEdit
=
"false"
/>
</
Columns
>
<
DayView
UserSelectable
=
"true"
SlotWidth
=
"65px"
DayHeaderDateFormat
=
"ddd"
TimeHeaderDateFormat
=
"H:mm"
/>
<
WeekView
UserSelectable
=
"true"
DayHeaderDateFormat
=
"ddd"
SlotWidth
=
"65px"
WeekHeaderDateFormat
=
"ddd"
/>
<
YearView
UserSelectable
=
"true"
MonthHeaderDateFormat
=
"M"
YearHeaderDateFormat
=
"Y"
SlotWidth
=
"65px"
/>
<
MonthView
UserSelectable
=
"true"
SlotWidth
=
"65px"
MonthHeaderDateFormat
=
"M"
WeekHeaderDateFormat
=
"ddd M/dd"
/>
</
telerik:RadGantt
>
<
Projects
>
<
Project
>
<
Tasks
>
<
Task
>
<
telerik:RadAjaxPanel
ID
=
"RadAjaxPanel2"
runat
=
"server"
Height
=
"100%"
Width
=
"100%"
HorizontalAlign
=
"NotSet"
LoadingPanelID
=
"baseLoadingPanel"
OnAjaxRequest
=
"RadAjaxPanel2_AjaxRequest"
>
<
asp:FormView
ID
=
"detailsView"
runat
=
"server"
OnDataBound
=
"detailsView_DataBound"
>
<
telerik:RadNumericTextBox
ID
=
"sphR"
runat
=
"server"
Width
=
"100%"
DbValue='<%# Eval("sphR") %>' Number="0" ReadOnly="True">
</
telerik:RadNumericTextBox
>
</
asp:FormView
>
</
telerik:RadAjaxPanel
>
protected
void
detailsView_DataBound(
object
sender, EventArgs e)
{
FormView item = (FormView)sender;
RadNumericTextBox c = ((RadNumericTextBox)item.FindControl(
"sphR"
));
c.Style.Add(
"text-align"
,
"right"
);
c.EnabledStyle.HorizontalAlign = HorizontalAlign.Right;
}
<
telerik:RadGrid
runat
=
"server"
ID
=
"Test_RadGrid"
AutoGenerateColumns
=
"false"
AllowPaging
=
"true"
OnNeedDataSource
=
"RadGrid_NeedDataSource"
OnUpdateCommand
=
"RadGrid_UpdateCommand"
OnItemCreated
=
"RadGrid_ItemCreated"
OnDeleteCommand
=
"RadGrid_DeleteCommand"
OnInsertCommand
=
"RadGrid_InsertCommand"
OnItemDataBound
=
"RadGrid_ItemDataBound"
>
<
MasterTableView
DataKeyNames
=
"ID"
CommandItemDisplay
=
"Top"
InsertItemPageIndexAction
=
"ShowItemOnCurrentPage"
EditMode
=
"InPlace"
>
<
Columns
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
/>
<
telerik:GridBoundColumn
DataField
=
"ID"
HeaderText
=
"ID"
ReadOnly
=
"true"
ForceExtractValue
=
"Always"
ConvertEmptyStringToNull
=
"true"
/>
<
telerik:GridBoundColumn
DataField
=
"Name"
HeaderText
=
"Name"
/>
<
telerik:GridDropDownColumn
UniqueName
=
"CustomerCombo"
HeaderText
=
"Customer"
DropDownControlType
=
"RadComboBox"
/>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
protected
void
RadGrid_NeedDataSource(
object
source, GridNeedDataSourceEventArgs e)
{
Test_RadGrid.DataSource = DataSource(); // linq to sql join statement
}
protected
void
RadGrid_ItemDataBound(
object
source, GridItemEventArgs e)
{
if
(e.Item
is
GridEditableItem && e.Item.IsInEditMode)
{
GridEditableItem editableItem = e.Item
as
GridEditableItem;
// ^---- At this point editableItem.KeyValues, in Watch window, says KeyValues threw an exception
// of type System.ArgumentOutOfRangeException, but doesn't break
GridEditManager editManager = editableItem.EditManager
as
GridEditManager;
GridDropDownListColumnEditor editor = editManager.GetColumnEditor(
"CustomerCombo"
)
as
GridDropDownListColumnEditor;
//editor.DataSource = Customer.DataSource();
//editor.DataValueField = TestField.ID;
//editor.DataTextField = TestField.Name;
//editor.DataBind();
RadComboBox combo = editableItem[TestField.CustomerCombo].Controls[0]
as
RadComboBox;
combo.AppendDataBoundItems =
true
;
combo.Items.Insert(0,
new
RadComboBoxItem(
"No customer selected"
,
"0"
));
var ret = (
int
)editableItem.GetDataKeyValue(
"0"
);
// <-- OutOfRangeException thown, debugger
}
<
asp:UpdatePanel
ID
=
"_updatePanel"
runat
=
"server"
UpdateMode
=
"Conditional"
>
<
ContentTemplate
>
...
<
telerik:RadAsyncUpload
ID
=
"fileUpload"
runat
=
"server"
MaxFileInputsCount
=
"1"
OnClientFilesSelected
=
"fileUpload_ClientFilesSelected"
/><
br
/>
<
asp:Button
ID
=
"_saveNewFileButton"
runat
=
"server"
OnClick
=
"_saveNewFileButton_Click"
<br> Text="Save"/>
</
ContentTemplate
>
</
asp:UpdatePanel
>
var
FilesUpdateInterval =
null
;
//Handles client side FilesSelected event for _newFileUploadButton.
function
fileUpload_ClientFilesSelected(sender, args) {
//disable the click event for submit button during upload<
var
submitButton = $find(
'<%= _saveNewFileButton.ClientID %>'
);
submitButton.set_text(
'Please Wait for Attachment Upload...'
);
submitButton.set_readOnly(
true
);
if
(FilesUpdateInterval ==
null
) {
FilesUpdateInterval = setInterval(
function
() { FileCheckForUploadCompletion(); }, 500);
}
}
All,
Below is the code for my rad grid, and I want to get the selected item value of the rad combo box "not text" in gridbatchedit command.
command.NewValues["Description"] --want to text the selected item value, instead of text
protected void rgReleaseSchedule_Prerender(object sender, EventArgs e)
{
{
SavedChangesList.ForeColor = System.Drawing.Color.Red;
RadComboBox ddlDesc = rgReleaseSchedule.FindControl(rgReleaseSchedule.MasterTableView.ClientID + "_Description").FindControl("rdDescription") as RadComboBox;
var description = IoC.Current.Resolve<IReleaseService>().ReleaseListScheduleTitle();
ddlDesc.DataSource = description;
ddlDesc.DataTextField = "Description";
ddlDesc.DataValueField = "TitleID";
ddlDesc.DataBind();
}
}
protected void rgReleaseSchedule_BatchEditCommand(object sender, Telerik.Web.UI.GridBatchEditingEventArgs e)
{
try
{
SavedChangesList.Items.Clear();
SavedChangesList.ForeColor = System.Drawing.Color.Red;
foreach (GridBatchEditingCommand command in e.Commands)
{
Hashtable newvalues= command.NewValues;
if (command.Type == GridBatchEditingCommandType.Update)
{
if (command.NewValues["Date"].ToString() != "" && command.NewValues["Time"].ToString() != "" && command.NewValues["Description"].ToString() != "")
{
Int32 result = IoC.Current.Resolve<IReleaseService>().ReleaseListUpdate((Int32)command.Item.OwnerTableView.DataKeyValues[command.Item.ItemIndex]["ID"],
(DateTime)command.NewValues["Date"], command.NewValues["Time"].ToString(), command.NewValues["Description"]);
}