or
If (String.IsNullOrEmpty(Me.grdShiftObservation.MasterTableView.FilterExpression)) Then
Me.grdShiftObservation.MasterTableView.FilterExpression = dtFromString
Else
Me.grdShiftObservation.MasterTableView.FilterExpression = Me.grdShiftObservation.MasterTableView.FilterExpression & " AND " & dtFromString
end if
========================== Exception.ascx.cs=====================================================
protected void grdFatal_PreRender(object sender, EventArgs e)
{
if (grdFatal.Items.Count != 0)
{
GridColumn grdCellTower = grdFatal.MasterTableView.GetColumn("CellTowerId");
grdCellTower.HeaderStyle.Width = Unit.Pixel(80);
GridColumn grdDate = grdFatal.MasterTableView.GetColumn("Date");
grdDate.HeaderStyle.Width = Unit.Pixel(80);
GridColumn grdFWVer = grdFatal.MasterTableView.GetColumn("FWVer");
grdFWVer.HeaderStyle.Width = Unit.Pixel(55);
GridColumn grdLastStatus = grdFatal.MasterTableView.GetColumn("LastStatus");
grdLastStatus.HeaderStyle.Width = Unit.Pixel(65);
GridColumn grdMeterType = grdFatal.MasterTableView.GetColumn("MeterType");
grdMeterType.HeaderStyle.Width = Unit.Pixel(95);
GridColumn grdModemFWVer = grdFatal.MasterTableView.GetColumn("ModemFWVer");
grdModemFWVer.HeaderStyle.Width = Unit.Pixel(120);
GridColumn grdSerialNumber = grdFatal.MasterTableView.GetColumn("SerialNumber");
grdSerialNumber.HeaderStyle.Width = Unit.Pixel(120);
GridColumn grdStatusId = grdFatal.MasterTableView.GetColumn("StatusId");
grdStatusId.HeaderStyle.Width = Unit.Pixel(55);
GridColumn grdStatusName = grdFatal.MasterTableView.GetColumn("StatusName");
grdStatusName.HeaderStyle.Width = Unit.Pixel(90);
GridColumn grdTxJobId = grdFatal.MasterTableView.GetColumn("TxJobId");
grdTxJobId.HeaderStyle.Width = Unit.Pixel(58);
}
}
========================== Exception.ascx=====================================================
function ColumnResizing(sender, args) {
if (args._gridColumn._data.UniqueName == "CellTowerId" && args._gridColumn._columnResizer._currentWidth <
80
)
{
args._cancel
=
true
; }
else if (args._gridColumn._data.UniqueName == "Date" && args._gridColumn._columnResizer._currentWidth < 80)
{
args._cancel
=
true
; }
else if (args._gridColumn._data.UniqueName == "FWVer" && args._gridColumn._columnResizer._currentWidth < 55)
{
args._cancel
=
true
; }
else if (args._gridColumn._data.UniqueName == "LastStatus" && args._gridColumn._columnResizer._currentWidth < 65)
{
args._cancel
=
true
; }
else if (args._gridColumn._data.UniqueName == "MeterType" && args._gridColumn._columnResizer._currentWidth < 95)
{
args._cancel
=
true
; }
else if (args._gridColumn._data.UniqueName == "ModemFWVer" && args._gridColumn._columnResizer._currentWidth < 120)
{
args._cancel
=
true
; }
else if (args._gridColumn._data.UniqueName == "SerialNumber" && args._gridColumn._columnResizer._currentWidth < 120)
{
args._cancel
=
true
; }
else if (args._gridColumn._data.UniqueName == "StatusId" && args._gridColumn._columnResizer._currentWidth < 55)
{
args._cancel
=
true
; }
else if (args._gridColumn._data.UniqueName == "StatusName" && args._gridColumn._columnResizer._currentWidth < 108)
{
args._cancel
=
true
; }
else if (args._gridColumn._data.UniqueName == "TxJobId" && args._gridColumn._columnResizer._currentWidth < 90)
{
args._cancel
=
true
; }
else if (args._gridColumn._data.UniqueName == "Error" && args._gridColumn._columnResizer._currentWidth < 600)
{
args._cancel
=
true
; }
}
</script>
<
div
id
=
"divGrid"
style
=
"margin-left:5px;"
>
<
telerik:RadGrid
ID
=
"grdFatal"
AllowMultiRowSelection
=
"True"
runat
=
"server"
AllowPaging
=
"True"
OnSelectedIndexChanged
=
"grdFatal_OnSelectedIndexChanged"
ShowStatusBar
=
"True"
Width
=
"99%"
onprerender
=
"grdFatal_PreRender"
onitemcreated
=
"grdFatal_ItemCreated"
onneeddatasource
=
"grdFatal_NeedDataSource"
CellSpacing
=
"0"
GridLines
=
"Horizontal"
Skin
=
"WebBlue"
AllowSorting
=
"True"
>
<
MasterTableView
PageSize
=
"10"
TableLayout
=
"Fixed"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
/>
<
RowIndicatorColumn
Visible
=
"True"
FilterControlAltText
=
"Filter RowIndicator column"
/>
<
ExpandCollapseColumn
Visible
=
"True"
FilterControlAltText
=
"Filter ExpandColumn column"
/>
<
Columns
>
<
telerik:GridClientSelectColumn
UniqueName
=
"ClientSelectColumn"
HeaderStyle-Width
=
"30px"
Resizable
=
"False"
>
<
HeaderStyle
Width
=
"30px"
></
HeaderStyle
>
</
telerik:GridClientSelectColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
/>
</
EditFormSettings
>
</
MasterTableView
>
<
HeaderStyle
Wrap
=
"false"
HorizontalAlign
=
"Left"
VerticalAlign
=
"Middle"
/>
<
ItemStyle
Wrap
=
"true"
HorizontalAlign
=
"Left"
VerticalAlign
=
"Middle"
/>
<
PagerStyle
Mode
=
"NumericPages"
/>
<
ClientSettings
EnableRowHoverStyle
=
"true"
EnablePostBackOnRowClick
=
"true"
>
<
Selecting
CellSelectionMode
=
"None"
AllowRowSelect
=
"True"
/>
<
Selecting
AllowRowSelect
=
"True"
/>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"true"
SaveScrollPosition
=
"true"
></
Scrolling
>
<
Resizing
AllowColumnResize
=
"true"
AllowRowResize
=
"false"
ResizeGridOnColumnResize
=
"false"
ClipCellContentOnResize
=
"true"
EnableRealTimeResize
=
"false"
AllowResizeToFit
=
"true"
/>
<
ClientEvents
OnColumnResizing
=
"ColumnResizing"
/>
</
ClientSettings
>
<
FilterMenu
EnableImageSprites
=
"False"
></
FilterMenu
>
</
telerik:RadGrid
>
</
div
>
Protected
Sub
mnuLifts_ItemClick(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.Web.UI.RadPanelBarEventArgs)
Handles
mnuLifts.ItemClick
Dim
intDay
As
Integer
=
Date
.Today.Day - 1
Dim
strURL
As
String
=
String
.Empty
AllParams =
New
clsParameters
With
AllParams
.CustomerID =
Me
.cboCustomer.SelectedValue
.CustomerName =
Me
.cboCustomer.Text
Select
Case
Cint(e.Item.Value)
Case
1
.qryBase =
"uspStoredProc1"
.BDate =
CDate
(Today.
Date
)
.Edate =
CDate
(Today.
Date
)
strURL =
"xxxxxxxx.aspx"
AllParams.Title =
Me
.cboCustomer.Text &
"text here ommited"
Case
2
.qryBase =
"uspStoredProc2"
AllParams.BDate =
String
.Empty
AllParams.Edate =
String
.Empty
strURL =
"yyyyyyyyyy.aspx"
AllParams.Title =
Me
.cboCustomer.Text &
"text here ommited"
Case
"3"
' lifts per month
.qryBase =
"uspStoredProc3"
AllParams.BDate =
CDate
(DateAdd(DateInterval.Day, -intDay, Today.
Date
))
AllParams.Edate =
CDate
(Today.
Date
)
strURL =
"zzzzzz.aspx"
AllParams.Title =
Me
.cboCustomer.Text & ControlChars.CrLf &
"text here ommited "
& AllParams.BDate.ToString &
" to "
& AllParams.Edate.ToString
End
Select
End
With
ScriptManager.RegisterStartupScript(
Me
.Page, Page.
GetType
(),
"radWin"
,
"MyFunction(); return false"
,
True
)
End
Sub
<script type=
"text/javascript"
>
function
OpenCommun() {
var
wnd = $find(
"<%=dlgCommun.ClientID%>"
);
wnd.setUrl(
"xxxxxxxxxxxxxx.aspx"
);
wnd.show();
}
function
GetRadWindow() {
var
oWindow =
null
;
if
(window.radWindow) oWindow = window.radWindow;
else
if
(window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
return
oWindow;
}
function
CloseCommun() {
GetRadWindow().close();
}
</script>
Hi,
For most of the grids in our project, there are more than 35 columns,to minimize the time taken to load the grid, we are trying to use the gridpersister to save the settings for individual user, so that the user can customize the number of columns they want to see everytime.
Saving the grid setting data works fine. While loading the settings data in grid, the column header and data gets wrapped or clipped and sometimes some of the columns which is supposed to be visible are hidden and sometimes we cannot scroll to the end of grid and some columns at the end are clipped.
Below is the grid definition:
<
telerik:RadGrid
ID
=
"RadReportGrid0"
runat
=
"server"
AllowPaging
=
"True"
AutoSize
=
"true"
AllowSorting
=
"True"
DataSourceID
=
"SqlDataSourceSearch"
GridLines
=
"None"
Skin
=
"Vista"
AutoGenerateColumns
=
"False"
Width
=
"99%"
onitemcreated
=
"RadReportGrid0_ItemCreated"
EnableHeaderContextMenu
=
"True"
PageSize
=
"20"
onitemdatabound
=
"RadReportGrid0_ItemDataBound"
OnPageSizeChanged
=
"RadReportGrid0_PageSizeChanged"
oninit
=
"RadReportGrid0_Init"
AllowFilteringByColumn
=
"false"
GroupingEnabled
=
"false"
>
<
headercontextmenu
skin
=
"Vista"
>
<
collapseanimation
duration
=
"200"
type
=
"OutQuint"
>
</
collapseanimation
>
</
headercontextmenu
>
<
selecteditemstyle
CssClass
=
"SelectedItem"
></
selecteditemstyle
>
<
PagerStyle
AlwaysVisible
=
"True"
Position
=
"TopAndBottom"
NextPageText
=
"Next"
PrevPageText
=
"Prev"
Mode
=
"NextPrevAndNumeric"
/>
<
mastertableview
AutoGenerateColumns
=
"False"
datakeynames
=
"key1,key14"
ClientDataKeyNames
=
"Key1,Key14"
datasourceid
=
"SqlDataSourceSearch"
AllowMultiColumnSorting
=
"True"
>
<
norecordstemplate
>
No record to display
</
norecordstemplate
>
<
HeaderStyle
HorizontalAlign
=
"Left"
VerticalAlign
=
"Bottom"
Wrap
=
"False"
/>
<
ItemStyle
Wrap
=
"False"
VerticalAlign
=
"Top"
HorizontalAlign
=
"Left"
/>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"Column1"
DataType
=
"System.DateTime"
FilterControlWidth
=
"100px"
FilterListOptions
=
"VaryByDataType"
HeaderText
=
"Upload Date"
ReadOnly
=
"True"
SortExpression
=
"Column1"
UniqueName
=
"Column1"
Groupable
=
"False"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column2"
DataType
=
"System.Decimal"
HeaderText
=
"Column2"
SortExpression
=
"Column2"
FilterControlWidth
=
"50px"
UniqueName
=
"Column2"
Groupable
=
"False"
>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
AllowFiltering
=
"false"
Groupable
=
"false"
>
<
ItemTemplate
>
<
asp:ImageButton
ID
=
"imgActionButton"
runat
=
"server"
src
=
"_assets/img/AddRecord2.gif"
></
asp:ImageButton
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column3"
HeaderText
=
"Column3"
FilterControlWidth
=
"50px"
ReadOnly
=
"True"
SortExpression
=
"Column3"
UniqueName
=
"Column3"
Groupable
=
"False"
DataType
=
"System.String"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column4"
HeaderText
=
"Column4"
FilterControlWidth
=
"50px"
SortExpression
=
"Column4"
UniqueName
=
"Column4"
Groupable
=
"False"
DataType
=
"System.String"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column5"
HeaderText
=
"Column5"
SortExpression
=
"Column5"
FilterControlWidth
=
"50px"
UniqueName
=
"Column5"
Groupable
=
"False"
DataType
=
"System.String"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column6"
HeaderText
=
"Column6"
FilterControlWidth
=
"50px"
ReadOnly
=
"True"
SortExpression
=
"Column6"
UniqueName
=
"Column6"
Groupable
=
"False"
DataType
=
"System.String"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column7"
FilterControlWidth
=
"100px"
DataType
=
"System.DateTime"
HeaderText
=
"Column7"
SortExpression
=
"Column7"
FilterListOptions
=
"VaryByDataType"
UniqueName
=
"Column7"
Groupable
=
"False"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column8"
HeaderText
=
"Column8"
ReadOnly
=
"True"
SortExpression
=
"Column8"
UniqueName
=
"Column8"
DataType
=
"System.String"
>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"Column9"
DataField
=
"Column9"
Groupable
=
"False"
DataType
=
"System.String"
FilterControlWidth
=
"100px"
>
<
HeaderTemplate
>
<
asp:Label
ID
=
"LabelAccountName"
runat
=
"server"
Text
=
"Account"
></
asp:Label
>
</
HeaderTemplate
>
<
ItemTemplate
>
<
asp:hyperlink
id
=
"AccountNameColumn"
runat
=
"server"
text='<%# Eval("AccountName")%>'></
asp:hyperlink
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column10"
FilterControlWidth
=
"100px"
HeaderText
=
"Column10"
SortExpression
=
"Column10"
UniqueName
=
"Column10"
Groupable
=
"False"
DataType
=
"System.String"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column11"
HeaderText
=
"Column11"
FilterControlWidth
=
"80px"
SortExpression
=
"Column11"
UniqueName
=
"Column11"
Groupable
=
"False"
DataType
=
"System.String"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column12"
HeaderText
=
"Column12"
FilterControlWidth
=
"80px"
SortExpression
=
"Column12"
UniqueName
=
"Column12"
Groupable
=
"False"
DataType
=
"System.Int16"
>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
UniqueName
=
"Column13"
DataField
=
"Column13"
Groupable
=
"False"
DataType
=
"System.String"
FilterControlWidth
=
"100px"
>
<
HeaderTemplate
>
<
asp:Label
ID
=
"LabelSerialNumber"
runat
=
"server"
Text
=
"Serial Number"
></
asp:Label
>
</
HeaderTemplate
>
<
ItemTemplate
>
<
asp:hyperlink
id
=
"SerialNumberColumn"
runat
=
"server"
text='<%# Eval("SerialNumber")%>'></
asp:hyperlink
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column14"
FilterControlWidth
=
"100px"
DataType
=
"System.DateTime"
HeaderText
=
"Column14"
SortExpression
=
"Column14"
FilterListOptions
=
"VaryByDataType"
UniqueName
=
"Column14"
DataFormatString
=
"{0:d}"
Groupable
=
"False"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column15"
HeaderText
=
"Column15"
SortExpression
=
"Column15"
UniqueName
=
"Column15"
Groupable
=
"False"
DataType
=
"System.String"
FilterControlWidth
=
"80px"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column16"
HeaderText
=
"Column16"
SortExpression
=
"Column16"
UniqueName
=
"Column16"
Groupable
=
"False"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column17"
HeaderText
=
"Column17"
SortExpression
=
"Column17"
UniqueName
=
"Column17"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column18"
FilterControlWidth
=
"80px"
HeaderText
=
"Column18"
SortExpression
=
"Column18"
UniqueName
=
"Column18"
Groupable
=
"False"
DataType
=
"System.String"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column19"
FilterControlWidth
=
"80px"
HeaderText
=
"Column19"
SortExpression
=
"Column19"
DataType
=
"System.String"
UniqueName
=
"Column19"
Groupable
=
"False"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column20"
DataType
=
"System.Decimal"
FilterControlWidth
=
"80px"
HeaderText
=
"Column20"
ReadOnly
=
"True"
SortExpression
=
"Column20"
UniqueName
=
"Column20"
Display
=
"True"
Groupable
=
"False"
Visible
=
"True"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column21"
DataType
=
"System.Decimal"
FilterControlWidth
=
"80px"
HeaderText
=
"Column21"
ReadOnly
=
"True"
SortExpression
=
"Column21"
UniqueName
=
"Column21"
Display
=
"True"
Groupable
=
"False"
Visible
=
"True"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column22"
DataType
=
"System.Decimal"
FilterControlWidth
=
"80px"
HeaderText
=
"Column22"
ReadOnly
=
"True"
SortExpression
=
"Column22"
UniqueName
=
"Column22"
Display
=
"True"
Groupable
=
"False"
Visible
=
"True"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column23"
DataType
=
"System.Decimal"
FilterControlWidth
=
"80px"
HeaderText
=
"Column23"
ReadOnly
=
"True"
SortExpression
=
"Column23"
UniqueName
=
"Column23"
Display
=
"True"
Groupable
=
"False"
Visible
=
"True"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column24"
DataType
=
"System.Decimal"
FilterControlWidth
=
"80px"
HeaderText
=
"Column23"
ReadOnly
=
"True"
SortExpression
=
"Column23"
UniqueName
=
"Column23"
Display
=
"True"
Groupable
=
"False"
Visible
=
"True"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column24"
DataType
=
"System.Decimal"
FilterControlWidth
=
"80px"
HeaderText
=
"Column24"
ReadOnly
=
"True"
SortExpression
=
"Column24"
UniqueName
=
"Column24"
Display
=
"True"
Groupable
=
"False"
Visible
=
"True"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column25"
DataType
=
"System.Decimal"
FilterControlWidth
=
"80px"
HeaderText
=
"Column25"
ReadOnly
=
"True"
SortExpression
=
"Column25"
UniqueName
=
"Column25"
Display
=
"True"
Groupable
=
"False"
DataFormatString
=
"{0:F2}hr"
Visible
=
"True"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column26"
DataType
=
"System.Decimal"
FilterControlWidth
=
"80px"
HeaderText
=
"Column26"
ReadOnly
=
"True"
SortExpression
=
"Column26"
UniqueName
=
"Column26"
Display
=
"True"
Groupable
=
"False"
DataFormatString
=
"{0:F2}%"
Visible
=
"True"
>
</
telerik:GridBoundColumn
>
<
telerik:GridCalculatedColumn
HeaderText
=
"Column27"
UniqueName
=
"Column27"
DataType
=
"System.Double"
DataFormatString
=
"{0:F2}hr"
DataFields
=
"Column27,Column26"
Expression
=
"{0}*100/{1}"
>
</
telerik:GridCalculatedColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column28"
HeaderText
=
"Column28"
ReadOnly
=
"True"
SortExpression
=
"Column28"
UniqueName
=
"Column28"
Display
=
"True"
Groupable
=
"False"
Visible
=
"True"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column29"
HeaderText
=
"Column29"
ReadOnly
=
"True"
SortExpression
=
"Column29"
UniqueName
=
"Column29"
Display
=
"True"
Groupable
=
"False"
Visible
=
"True"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column30"
HeaderText
=
"Column30"
ReadOnly
=
"True"
SortExpression
=
"Column30"
UniqueName
=
"Column30"
Display
=
"True"
Groupable
=
"False"
Visible
=
"True"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column31"
HeaderText
=
"Column31"
ReadOnly
=
"True"
SortExpression
=
"Column31"
UniqueName
=
"Column31"
Display
=
"True"
Groupable
=
"False"
Visible
=
"True"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Column32"
HeaderText
=
"Column32"
ReadOnly
=
"True"
SortExpression
=
"Column32"
UniqueName
=
"Column32"
Display
=
"True"
Groupable
=
"False"
Visible
=
"True"
>
</
telerik:GridBoundColumn
>
</
Columns
>
</
mastertableview
>
<
ClientSettings
AllowDragToGroup
=
"True"
AllowColumnsReorder
=
"True"
ReorderColumnsOnClient
=
"True"
>
<
Selecting
AllowRowSelect
=
"True"
/>
<
Scrolling
AllowScroll
=
"true"
UseStaticHeaders
=
"True"
/>
<
ClientEvents
OnRowContextMenu
=
"RowContextMenu"
/>
</
ClientSettings
>
<
filtermenu
Skin
=
"Vista"
>
<
collapseanimation
duration
=
"200"
type
=
"OutQuint"
>
</
collapseanimation
>
</
filtermenu
>
</
telerik:RadGrid
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
AllowPaging
=
"True"
AutoGenerateColumns
=
"False"
CellSpacing
=
"0"
Culture
=
"de-DE"
DataSourceID
=
"ObjectDataSource1"
GridLines
=
"None"
Width
=
"450px"
AllowSorting
=
"True"
ShowFooter
=
"True"
ondeletecommand
=
"RadGrid1_DeleteCommand"
oninsertcommand
=
"RadGrid1_InsertCommand"
onitemcommand
=
"RadGrid1_ItemCommand"
onitemdatabound
=
"RadGrid1_ItemDataBound"
onupdatecommand
=
"RadGrid1_UpdateCommand"
>
<
ClientSettings
>
<
Selecting
CellSelectionMode
=
"None"
/>
</
ClientSettings
>
<
MasterTableView
AllowAutomaticDeletes
=
"True"
AllowAutomaticInserts
=
"True"
AllowAutomaticUpdates
=
"True"
CommandItemDisplay
=
"TopAndBottom"
DataKeyNames
=
"ResID"
DataSourceID
=
"ObjectDataSource1"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
/>
<
RowIndicatorColumn
FilterControlAltText
=
"Filter RowIndicator column"
Visible
=
"True"
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
FilterControlAltText
=
"Filter ExpandColumn column"
Visible
=
"True"
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridTemplateColumn
DataField
=
"ResWidth"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter ResWidth column"
HeaderText="<%$ Resources:BasicSettings, Width %>" SortExpression="ResWidth"
UniqueName="ResWidth">
<
EditItemTemplate
>
<
telerik:RadNumericTextBox
ID
=
"RadNumericTextBox1"
Runat
=
"server"
Culture
=
"de-DE"
DbValue='<%# Bind("ResWidth") %>' LabelWidth="" MinValue="0"
Width="125px">
<
NumberFormat
DecimalDigits
=
"0"
ZeroPattern
=
"n"
/>
</
telerik:RadNumericTextBox
>
<
asp:RequiredFieldValidator
ID
=
"RequiredFieldValidator1"
runat
=
"server"
ControlToValidate
=
"RadNumericTextBox1"
Display
=
"Dynamic"
ErrorMessage="<%$ Resources:BasicSettings, RequiredValidation %>"></
asp:RequiredFieldValidator
>
</
EditItemTemplate
>
<
ItemTemplate
>
<
asp:Label
ID
=
"ResWidthLabel"
runat
=
"server"
Text='<%# Eval("ResWidth") %>'></
asp:Label
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridTemplateColumn
DataField
=
"ResHeight"
DataType
=
"System.Int32"
FilterControlAltText
=
"Filter ResHeight column"
HeaderText="<%$ Resources:BasicSettings, Height %>" SortExpression="ResHeight"
UniqueName="ResHeight">
<
EditItemTemplate
>
<
telerik:RadNumericTextBox
ID
=
"RadNumericTextBox2"
Runat
=
"server"
Culture
=
"de-DE"
DbValue='<%# Bind("ResHeight") %>' LabelWidth="" MinValue="0"
Width="125px">
<
NumberFormat
DecimalDigits
=
"0"
ZeroPattern
=
"n"
/>
</
telerik:RadNumericTextBox
>
<
asp:RequiredFieldValidator
ID
=
"RequiredFieldValidator2"
runat
=
"server"
ControlToValidate
=
"RadNumericTextBox2"
Display
=
"Dynamic"
ErrorMessage="<%$ Resources:BasicSettings, RequiredValidation %>"></
asp:RequiredFieldValidator
>
</
EditItemTemplate
>
<
ItemTemplate
>
<
asp:Label
ID
=
"ResHeightLabel"
runat
=
"server"
Text='<%# Eval("ResHeight") %>'></
asp:Label
>
</
ItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridEditCommandColumn
ButtonType
=
"ImageButton"
FilterControlAltText
=
"Filter EditCommandColumn column"
HeaderText="<%$ Resources:BasicSettings, Edit %>">
</
telerik:GridEditCommandColumn
>
<
telerik:GridButtonColumn
ButtonType
=
"ImageButton"
CommandName
=
"Delete"
ConfirmText="<%$ Resources:BasicSettings, ConfirmDelete %>"
HeaderText="<%$ Resources:BasicSettings, Delete %>" Text="Delete"
UniqueName="DeleteColumn">
</
telerik:GridButtonColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn1 column"
UniqueName
=
"EditCommandColumn1"
>
</
EditColumn
>
</
EditFormSettings
>
</
MasterTableView
>
<
FilterMenu
EnableImageSprites
=
"False"
>
</
FilterMenu
>
</
telerik:RadGrid
>
<
asp:ObjectDataSource
ID
=
"ObjectDataSource1"
runat
=
"server"
TypeName
=
"ResolutionsBLL"
InsertMethod
=
"InsertResolutions"
SelectMethod
=
"GetResolutions"
DeleteMethod
=
"DeleteResolution"
UpdateMethod
=
"UpdateResolution"
>
<
DeleteParameters
>
<
asp:Parameter
Name
=
"resID"
Type
=
"Int32"
/>
</
DeleteParameters
>
<
InsertParameters
>
<
asp:Parameter
Name
=
"ResWidth"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"ResHeight"
Type
=
"Int32"
/>
</
InsertParameters
>
<
SelectParameters
>
<
asp:Parameter
DefaultValue
=
"1"
Name
=
"resArt"
Type
=
"Int32"
/>
</
SelectParameters
>
<
UpdateParameters
>
<
asp:Parameter
Name
=
"resArt"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"resWidth"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"resHeight"
Type
=
"Int32"
/>
<
asp:Parameter
Name
=
"resID"
Type
=
"Int32"
/>
</
UpdateParameters
>
</
asp:ObjectDataSource
>
protected
void
RadGrid1_DeleteCommand(
object
sender, GridCommandEventArgs e)
{
try
{
int
ID = Convert.ToInt32(e.Item.OwnerTableView.DataKeyValues[e.Item.ItemIndex][
"ResID"
].ToString());
string
logtext =
string
.Format(
"Delete {0} x {1}"
,
oldWidth, oldHeight);
// I need this here
UserEventsBLL uev =
new
UserEventsBLL();
uev.AddUserEvent(thisUser.UserName,
"deleteRes"
, logtext, Request.Url.AbsolutePath,
null
, ID,
null
);
}
catch
(Exception ex)
{
ErrorsBLL errors =
new
ErrorsBLL();
errors.AddErrors(203, Request.Url.AbsolutePath, ex.Message, thisUser.UserName,
""
);
}
}