I have a grid that has a gridtemplatecolumn for a checkbox. In the header I have a checkbox to select/unselect all.The grid allows pagination and filtering. I run an OnCheckedChanged function on the checkbox in the header. I disable paging, rebind, loop through the records to update my record(s) in the database, enable paging and rebind again. The saving and selecting of each row on the pages works. The problem is that when I enable paging and rebind the grid, the checkbox in the header goes to unselected. The grid/check box no longer knows that the user checked the check box and that all visible rows in the grid are selected so the checkbox should be selected still. This would give the user the option to unselected the header checkbox to unselect all the rows.
My question is how to tell the checkbox in the header, that all the rows that are visible in the grid (due to filtering applied, or pagination on) are selected so select the checkbox in the header to allow the user to unselect. At this point, my grid can show 10 records at a time, the user can filter to the rows they want while still having pagination on. They can select the header checkbox to select all of the rows but have no option to use the header to unselect all the rows.
Below are snippets of the aspx gridtemplate column and the aspx.vb OnCheckedChanged function.
<telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn" HeaderText="Selected" AllowFiltering="false">
<ItemStyle Width="45px" Wrap="false" />
<HeaderStyle Width="45px" Wrap="false" />
<ItemTemplate>
<asp:CheckBox ID="cbSelectedSearchResults" runat="server" Checked='<%# GetBooleanValue(Eval("Selected")) %>' OnCheckedChanged="ToggleRowSelectionSearchResults" AutoPostBack="True" />
</ItemTemplate>
<HeaderTemplate>
<asp:CheckBox Text="" ID="headerChkboxSearchResults" runat="server" OnCheckedChanged="ToggleSelectedStateSearchResults" AutoPostBack="True" />
</HeaderTemplate>
</telerik:GridTemplateColumn>
Protected Sub ToggleSelectedStateSearchResults(ByVal sender As Object, ByVal e As EventArgs)
Dim headerCheckBox As CheckBox = TryCast(sender, CheckBox)
selectAll = headerCheckBox.Checked
Dim strSQL As String = ""
Dim selected As Integer = 0
Dim ID As Integer = 0
rgSelections.MasterTableView.AllowPaging = False
rgSelections.Rebind()
For Each dataItem As GridDataItem In rgSelections.MasterTableView.Items
TryCast(dataItem.FindControl("cbSelectedSearchResults"), CheckBox).Checked = headerCheckBox.Checked
dataItem.Selected = headerCheckBox.Checked
ID = dataItem.GetDataKeyValue("ID")
If headerCheckBox.Checked Then
selected = 1
End If
Try
strSQL = "update bridge.dbo.Tmp_BridgeJobOptions" & ucHeader1.SessionId & " set selected = " & selected & " where id = " & ID
mobjBridgeDatabase.subExecuteNonQuery(strSQL)
Catch ex As SqlException
Throw New Exception(ex.Message & ", SQL: " & strSQL & ",frmBridgeLineCreation.ToggleSelectedStateSearchResults")
End Try
Next
rgSelections.MasterTableView.AllowPaging = True
rgSelections.Rebind()
For Each dataItem As GridDataItem In rgSelections.MasterTableView.Items
TryCast(dataItem.FindControl("cbSelectedSearchResults"), CheckBox).Checked = headerCheckBox.Checked
dataItem.Selected = headerCheckBox.Checked
Next
End Sub
Attached is a picture of my grid right after I checked the checkbox in the header. You can see all my rows are selected, but the header is back to unselected.
If you don't see a message that shows the path of the problem assembly, try dragging a RadScheduler onto the page to see if that shows the details paths.
Edit - 1/23/2012
This problem seemed to persist in later days, and I finally found a good work around. In your web.config, you need to change this...
<
pages
>
<
controls
>
<
add
tagPrefix
=
"telerik"
namespace
=
"Telerik.Web.UI"
assembly
=
"Telerik.Web.UI"
/>
</
controls
>
</
pages
>
... to this.
<
pages
>
<
controls
>
<
add
tagPrefix
=
"telerik"
namespace
=
"Telerik.Web.UI"
assembly
=
"Telerik.Web.UI, Version=2011.3.1305.40, Culture=neutral, PublicKeyToken=121fae78165ba3d4"
/>
</
controls
>
</
pages
>
Remember to change the version number to the version you have installed in your application.
This works, but it does mean that you will have to manually update the version number if you ever upgrade your application in the future, but at least it will not generate all those errors.
If anyone has a better solution, I would love to hear it.
I hope this helps.
Thanks,
King Wilder
Is the a standard way of setting the default filter in the vb code-behind for a GridDateTimeColumn that has RangeFiltering?
Following is the aspx code :
<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" Runat="server" IsSticky="True" EnableSkinTransparency="true" Transparency="40" >
</telerik:RadAjaxLoadingPanel>
<telerik:RadAjaxManagerProxy ID="RadAjaxManagerProxy1" runat="server" >
<AjaxSettings>
<telerik:AjaxSetting AjaxControlID="Button1">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="TestDiv"/>
</UpdatedControls>
</telerik:AjaxSetting>
<telerik:AjaxSetting AjaxControlID="Button3">
<UpdatedControls>
<telerik:AjaxUpdatedControl ControlID="abcd"/>
<telerik:AjaxUpdatedControl ControlID="TestDiv" />
</UpdatedControls>
</telerik:AjaxSetting>
</AjaxSettings>
</telerik:RadAjaxManagerProxy>
<asp:Button ID="Button3" runat="server" Text="Make Visible" OnClick="Button3_Click" />
<asp:Button ID="Button4" runat="server" Text="Make Invisible" OnClick="Button4_Click" />
<div id="abcd" runat="server" class="col-md-16 text-align-right top-margin-10" >
<div class="col-md-7">
</div>
<div class="col-md-9">
<div class="col-md-5" runat="server" style="display:block; text-align:center; ">
<fieldset class="border-for-div">
<legend class="caption-for-div"> Video streaming </legend>
<video id="video" autoplay="autoplay" width="200" height="120" style="border:solid; border-width:1px;" runat="server"></video>
</fieldset>
</div>
<div class="col-md-5" runat="server" style="display:block; text-align:center; ">
<fieldset class="border-for-div">
<legend class="caption-for-div"> Take Photo </legend>
<canvas width='160' height='120' style="border:solid; border-width:2px;" > </canvas>
</fieldset>
</div>
<div class="col-md-5">
<img id="Img1" runat="server" style="border:solid; border-width:5px;" width="160" height="120" visible="false" />
</div>
</div>
<br />
<input type="button" value="start capture" onclick="startCapture()" />
<input type="button" value="take snapshot" onclick="takePhoto()" />
<%--<input type="button" value="stop capture" onclick="stopCapture()" />--%>
<asp:TextBox ID="TextBox1" runat="server" ClientIDMode="Static"></asp:TextBox>
</div>
<div id="TestDiv" class="col-md-16 text-align-right top-margin-10" runat="server" >
<asp:textbox ID="textbox5" runat="server" Text="textbox5"></asp:textbox>
</div>
<script type="text/javascript">
var localMediaStream = null;
var video = document.querySelector('video');
var canvas = document.querySelector('canvas');
function takePhoto() {
if (localMediaStream) {
var ctx = canvas.getContext('2d');
ctx.drawImage(video, 0, 0, 160, 120);
//document.querySelector('img').src = canvas.toDataURL('image/jpeg');
var base64 = canvas.toDataURL('image/jpeg');
document.getElementById('TextBox1').value = base64;
}
}
navigator.getUserMedia = navigator.getUserMedia || navigator.webkitGetUserMedia || navigator.mozGetUserMedia || navigator.msGetUserMedia;
window.URL = window.URL || window.webkitURL;
function startCapture() {
navigator.getUserMedia({ video: true }, function (stream) {
video.src = window.URL.createObjectURL(stream);
localMediaStream = stream;
}, function (e) {
console.log(e);
});
}
function stopCapture() {
video.pause();
localMediaStream.stop();
}
</script>
Following is C# code :
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
abcd.Attributes["style"] = "Display:Normal;"; //None
TestDiv.Attributes["style"] = "Display:None;"; //Normal
}
}
protected void Button3_Click(object sender, EventArgs e)
{
abcd.Attributes["style"] = "Display:Normal;"; //None
video.Attributes["style"] = "Display:Normal;"; //None
TestDiv.Attributes["style"] = "Display:None;"; //Normal
}
protected void Button4_Click(object sender, EventArgs e)
{
abcd.Attributes["style"] = "Display:None;"; //None
video.Attributes["style"] = "Display:None;"; //None
TestDiv.Attributes["style"] = "Display:Normal;"; //Normal
}
The problem is as follows :
When the page is loaded and I click on Start Capture the video streaming starts. Click on Take Snapshot also puts an image on the canvas.
Now click on the button Make Invisible. This will hide the div in which the video and captured image are displayed and show the div with one textbox.
Now click on the button Make Visible. This will show the div in which the video and captured image are to be displayed and hide the div with one textbox.
The problem starts from here. Now if I press Start Capture button the web camera is started. but the video streaming is not visible.
I tried disabling the compression in my web.config file but still the problem is not resolved.
If I stop using radajaxmanager then every thing works fine.
Can any body help me in resolving this ?
Thanks
Milind
<
telerik:RadScheduler
ID
=
"DayViewScheduler"
runat
=
"server"
Height
=
"960"
ShowFooter
=
"False"
OverflowBehavior
=
"Expand"
DataKeyField
=
"Id"
HoursPanelTimeFormat
=
"hh:mm tt"
DataSubjectField
=
"Subject"
DataStartField
=
"StartDate"
ShowAllDayRow
=
"False"
ShowViewTabs
=
"False"
DataEndField
=
"EndDate"
TimeLabelRowSpan
=
"1"
CustomAttributeNames
=
"ServiceInstanceId,ServiceTypeValue,Details,ReservationColor,BlinkIndicator"
OnNavigationComplete
=
"DayViewScheduler_NavigationComplete"
OnDataBound
=
"DayViewScheduler_DataBound"
OnAppointmentDataBound
=
"DayViewScheduler_AppointmentDataBound"
OnFormCreating
=
"DayViewScheduler_FormCreating"
OnAppointmentDelete
=
"DayViewScheduler_AppointmentDelete"
OnAppointmentInsert
=
"DayViewScheduler_AppointmentInsert"
OnAppointmentUpdate
=
"DayViewScheduler_AppointmentUpdate"
OnClientAppointmentResizeStart
=
"OnClientAppointmentResizeStart"
OnAppointmentCreated
=
"DayViewScheduler_AppointmentCreated"
OnClientAppointmentMoveEnd
=
"onAppointmentMoveEnd"
OnClientAppointmentResizing
=
"onAppointmentResizing"
OnClientAppointmentResizeEnd
=
"onAppointmentResizeEnd"
EditFormDateFormat
=
"dd/MM/yyyy"
EditFormTimeFormat
=
"HH:mm"
meta:resourcekey
=
"DayViewSchedulerResource2"
Width
=
"960px"
>
<
MonthView
UserSelectable
=
"False"
/>
<
WeekView
UserSelectable
=
"False"
/>
<
TimelineView
UserSelectable
=
"False"
/>
<
ExportSettings
>
<
Pdf
PageBottomMargin
=
"1in"
PageLeftMargin
=
"1in"
PageRightMargin
=
"1in"
PageTopMargin
=
"1in"
/>
</
ExportSettings
>
<
AdvancedForm
Modal
=
"True"
/>
<
AppointmentTemplate
>
<
div
class
=
"personPopupTrigger"
rel='<%#Eval("Id")%>' url='<%=ResolveUrl("~") %>'>
<%# FormatText(Eval("Subject")) %>
<
dx:ASPxImage
ID
=
"ASPxImage1"
ImageUrl
=
"~/CSS/images/alertAppointment.gif"
runat
=
"server"
Visible='<%#Convert.ToBoolean(Eval("BlinkIndicator"))%>'>
</
dx:ASPxImage
>
</
div
>
</
AppointmentTemplate
>
</
telerik:RadScheduler
>
When Use two Grid in 1 Page There are GridTemplateColumn EditItemTemplate in both grid
EditMode="Batch" & save by function saveTableChanges
- TemplateColumn not work
- GridBoundColumn it Work
- ColumnEditor it Work
- 1 Grid on 1 Page GridBoundColumn it Work
<
head
>
<
title
>Test</
title
>
<
script
type
=
"text/javascript"
>
function SaveAllChanges(sender, args) {
var b = $find('<%=RadGrid1.ClientID%>').get_batchEditingManager();
var tableViews = [];
tableViews.push($find('<%=RadGrid1.ClientID%>').get_masterTableView());
tableViews.push($find('<%=RadGrid3.ClientID%>').get_masterTableView());
b.saveTableChanges(tableViews);
}
</
script
>
</
head
>
<
body
>
<
form
id
=
"Form1"
runat
=
"server"
>
<
telerik:RadScriptManager
Runat
=
"server"
></
telerik:RadScriptManager
>
<
telerik:RadButton
runat
=
"server"
ID
=
"RadButton1"
Text
=
"SaveAllChanges"
AutoPostBack
=
"false"
OnClientClicked
=
"SaveAllChanges"
></
telerik:RadButton
>
<
telerik:GridNumericColumnEditor
ID
=
"NumericEditor1"
runat
=
"server"
>
<
NumericTextBox
ID
=
"NumericTextBox1"
runat
=
"server"
Width
=
"60px"
/>
</
telerik:GridNumericColumnEditor
>
<
telerik:GridTextBoxColumnEditor
runat
=
"server"
ID
=
"TextEditor"
>
<
TextBoxStyle
Width
=
"120px"
/>
</
telerik:GridTextBoxColumnEditor
>
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
DataSourceID
=
"SqlDataSource3"
AllowPaging
=
"True"
AllowAutomaticUpdates
=
"True"
AllowAutomaticInserts
=
"True"
AllowAutomaticDeletes
=
"true"
AllowSorting
=
"true"
PageSize
=
"3"
OnBatchEditCommand
=
"RadGrid1_BatchEditCommand"
>
<
PagerStyle
Mode
=
"NextPrevAndNumeric"
/>
<
MasterTableView
DataSourceID
=
"SqlDataSource3"
AutoGenerateColumns
=
"False"
DataKeyNames
=
"CustomerID"
EditMode
=
"Batch"
CommandItemDisplay
=
"Top"
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"CustomerID"
HeaderText
=
"CustomerID"
SortExpression
=
"CustomerID"
UniqueName
=
"CustomerID"
>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"ContactName"
HeaderStyle-Width
=
"180px"
UniqueName
=
"ContactName"
>
<
ItemTemplate
>
<%# Eval("ContactName") %>
</
ItemTemplate
>
<
EditItemTemplate
>
<
asp:TextBox
ID
=
"TextBox1"
Text='<%# Bind("ContactName") %>' runat="server"></
asp:TextBox
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridBoundColumn
DataField
=
"CompanyName"
HeaderText
=
"CompanyName"
SortExpression
=
"CompanyName"
UniqueName
=
"CompanyName"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"ContactTitle"
HeaderText
=
"ContactTitle"
SortExpression
=
"ContactTitle"
UniqueName
=
"ContactTitle"
>
</
telerik:GridBoundColumn
>
<
telerik:GridBoundColumn
DataField
=
"Phone"
HeaderStyle-Width
=
"135px"
HeaderText
=
"Quantity Per Unit"
SortExpression
=
""
ColumnEditorID
=
"TextEditor"
UniqueName
=
"QuantityPerUnit"
>
</
telerik:GridBoundColumn
>
<
telerik:GridButtonColumn
Text
=
"Delete"
CommandName
=
"Delete"
ButtonType
=
"ImageButton"
/>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
<!--Grid2------------>
<
telerik:RadGrid
ID
=
"RadGrid3"
GridLines
=
"None"
runat
=
"server"
AllowAutomaticDeletes
=
"True"
AllowAutomaticInserts
=
"True"
PageSize
=
"3"
Skin
=
"Default"
AllowAutomaticUpdates
=
"True"
AllowPaging
=
"True"
AutoGenerateColumns
=
"False"
Width
=
"750px"
OnBatchEditCommand
=
"RadGrid3_BatchEditCommand"
DataSourceID
=
"SqlDataSource1"
>
<
MasterTableView
CommandItemDisplay
=
"TopAndBottom"
DataKeyNames
=
"ProductID"
DataSourceID
=
"SqlDataSource1"
HorizontalAlign
=
"NotSet"
EditMode
=
"Batch"
AutoGenerateColumns
=
"False"
>
<
BatchEditingSettings
EditType
=
"Cell"
/>
<
SortExpressions
>
<
telerik:GridSortExpression
FieldName
=
"ProductID"
SortOrder
=
"Descending"
/>
</
SortExpressions
>
<
Columns
>
<
telerik:GridBoundColumn
DataField
=
"ProductName"
HeaderStyle-Width
=
"210px"
HeaderText
=
"ProductName"
SortExpression
=
"ProductName"
UniqueName
=
"ProductName"
>
<
ColumnValidationSettings
EnableRequiredFieldValidation
=
"true"
>
<
RequiredFieldValidator
ForeColor
=
"Red"
Text
=
"*This field is required"
>
</
RequiredFieldValidator
>
</
ColumnValidationSettings
>
</
telerik:GridBoundColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"Category"
HeaderStyle-Width
=
"180px"
UniqueName
=
"CategoryID"
DataField
=
"CategoryID"
>
<
ItemTemplate
>
<%# Eval("CategoryName") %>
</
ItemTemplate
>
<
EditItemTemplate
>
<
telerik:RadDropDownList
runat
=
"server"
ID
=
"CategoryIDDropDown"
DataValueField
=
"CategoryID"
DataTextField
=
"CategoryName"
DataSourceID
=
"SqlDataSource2"
>
</
telerik:RadDropDownList
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridNumericColumn
DataField
=
"UnitsInStock"
HeaderStyle-Width
=
"80px"
ColumnEditorID
=
"NumericEditor1"
HeaderText
=
"Units In Stock"
SortExpression
=
"UnitsInStock"
UniqueName
=
"UnitsInStock"
>
</
telerik:GridNumericColumn
>
<
telerik:GridBoundColumn
DataField
=
"QuantityPerUnit"
HeaderStyle-Width
=
"135px"
HeaderText
=
"Quantity Per Unit"
SortExpression
=
"QuantityPerUnit"
ColumnEditorID
=
"TextEditor"
UniqueName
=
"QuantityPerUnit"
>
</
telerik:GridBoundColumn
>
<
telerik:GridCheckBoxColumn
DataField
=
"Discontinued"
HeaderStyle-Width
=
"80px"
HeaderText
=
"Discontinued"
SortExpression
=
"Discontinued"
UniqueName
=
"Discontinued"
>
</
telerik:GridCheckBoxColumn
>
<
telerik:GridTemplateColumn
HeaderText
=
"UnitPrice"
ColumnEditorID
=
"NumericEditor1"
HeaderStyle-Width
=
"80px"
SortExpression
=
"UnitPrice"
UniqueName
=
"TemplateColumn"
DataField
=
"UnitPrice"
>
<
ItemTemplate
>
<
asp:Label
runat
=
"server"
ID
=
"lblUnitPrice"
Text='<%# Eval("UnitPrice", "{0:C}") %>'></
asp:Label
>
</
ItemTemplate
>
<
EditItemTemplate
>
<
span
>
<
telerik:RadNumericTextBox
Width
=
"55px"
runat
=
"server"
ID
=
"tbUnitPrice"
>
</
telerik:RadNumericTextBox
>
<
span
style
=
"color: Red"
>
<
asp:RequiredFieldValidator
ID
=
"RequiredFieldValidator1"
ControlToValidate
=
"tbUnitPrice"
ErrorMessage
=
"*Required"
runat
=
"server"
>
</
asp:RequiredFieldValidator
>
</
span
>
</
span
>
</
EditItemTemplate
>
</
telerik:GridTemplateColumn
>
<
telerik:GridButtonColumn
ConfirmText
=
"Delete this product?"
ConfirmDialogType
=
"RadWindow"
ConfirmTitle
=
"Delete"
HeaderText
=
"Delete"
HeaderStyle-Width
=
"50px"
ButtonType
=
"ImageButton"
CommandName
=
"Delete"
Text
=
"Delete"
UniqueName
=
"DeleteColumn"
>
</
telerik:GridButtonColumn
>
</
Columns
>
</
MasterTableView
>
</
telerik:RadGrid
>
Hi all,
After downloading UI for ASP.Net Ajax R3 2016, Telerik Menu disappeared from VS 2013. Only JustCode is showing. Refer to attach.
However Telerik Controls are showing up under VS Tool Boxes.
I need the Telerik Upgrade wizard in VS Menu to upgrade my existing Projects/Reports with Latest Telerik Versions. I am stuck now.
Any Suggestions/Help will be appreciated.
Thanks
gc_0620
I have an AjaxLoadingPanel on my page to prevent users from clicking the submit button more than once. The first submission/postback works perfectly. After the first postback, a second submission causes the page to flash blank like it's refreshing and postback seemingly without AJAX. The child page content is fine, but the masterpage's header and side panel both end up missing the list of tabs and links for navigating the site. Further postbacks exhibit the same behavior and the masterpage doesn't recover until a manual refresh. There are 2 buttons on the page for submission of the form and display of entries. Regardless of which button is pressed or in what order it always happens on the second postback. Hopefully I've just set something up wrong with the LoadingPanel but any insight would be appreciated.
HTML markup below:
<
asp:Content
ID
=
"Content1"
ContentPlaceHolderID
=
"head"
runat
=
"Server"
>
<
telerik:RadCodeBlock
ID
=
"RadCodeBlock1"
runat
=
"server"
>
<
script
type
=
"text/javascript"
>
function pageLoad() {
var grid = $find("<%= gridAgents.ClientID %>");
var columns = grid.get_masterTableView().get_columns();
for (var i = 0; i <
columns.length
; i++) {
columns[i].resizeToFit();
}
}
</script>
</
telerik:RadCodeBlock
>
</
asp:Content
>
<
asp:Content
ID
=
"Content2"
ContentPlaceHolderID
=
"PageHeaderContentPlaceHolder"
runat
=
"Server"
>
</
asp:Content
>
<
asp:Content
ID
=
"Content3"
ContentPlaceHolderID
=
"SideBarPlaceHolder"
runat
=
"Server"
>
</
asp:Content
>
<
asp:Content
ID
=
"Content4"
ContentPlaceHolderID
=
"PageContentPlaceHolder"
runat
=
"Server"
>
<
asp:UpdatePanel
ID
=
"UpdatePanel1"
runat
=
"server"
>
<
ContentTemplate
>
<
div
class
=
"container"
>
<!-- Input controls for form fields -->
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"UpdatePanel1"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"UpdatePanel1"
LoadingPanelID
=
"RadAjaxLoadingPanel1"
></
telerik:AjaxUpdatedControl
>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
<
telerik:RadAjaxLoadingPanel
ID
=
"RadAjaxLoadingPanel1"
runat
=
"server"
IsSticky
=
"false"
BackgroundTransparency
=
"70"
Direction
=
"LeftToRight"
EnableSkinTransparency
=
"true"
Skin
=
"Default"
Style
=
"position: center; width: 100%"
>
</
telerik:RadAjaxLoadingPanel
>
<
br
/>
<
br
/>
From: <
telerik:RadNumericTextBox
ID
=
"txtFrom"
runat
=
"server"
CssClass
=
"form-control"
NumberFormat-DecimalDigits
=
"0"
MinValue
=
"0"
Width
=
"50px"
NumberFormat-GroupSeparator
=
""
></
telerik:RadNumericTextBox
>
To: <
telerik:RadNumericTextBox
ID
=
"txtTo"
runat
=
"server"
CssClass
=
"form-control"
NumberFormat-DecimalDigits
=
"0"
MinValue
=
"0"
Width
=
"50px"
NumberFormat-GroupSeparator
=
""
></
telerik:RadNumericTextBox
>
<
asp:Button
ID
=
"btnSet"
runat
=
"server"
Text
=
"Set"
CssClass
=
"btn btn-primary"
OnClick
=
"btnSet_Click"
/>
<
div
id
=
"output"
runat
=
"server"
style
=
"height: 70px; width: 100%; overflow: auto"
>
<
telerik:RadGrid
ID
=
"grid"
runat
=
"server"
AutoGenerateColumns
=
"true"
DataSourceID
=
"DataSource"
>
<
ClientSettings
>
<
Resizing
AllowColumnResize
=
"true"
ResizeGridOnColumnResize
=
"true"
AllowResizeToFit
=
"true"
EnableRealTimeResize
=
"true"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
</
div
>
<
asp:SqlDataSource
ID
=
"DataSource"
runat
=
"server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>" SelectCommand=""></
asp:SqlDataSource
>
</
div
>
</
ContentTemplate
>
</
asp:UpdatePanel
>
</
asp:Content
>
C# backend below:
protected void Page_Load(object sender, EventArgs e)
{
}
protected void btnInput_Click(object sender, EventArgs e)
{
//Object creation and SQL insert
if (err.Equals(String.Empty))
{
DataSource.SelectCommand = "SELECT * FROM [Table] WHERE [Col] = " + id.ToString();
output.Attributes.CssStyle.Add("height", "70px");
lblSuccess.Visible = true;
clearControls(); //sets control fields to empty
}
else
{
lblErr.Visible = true;
lblErr.Text = err;
}
}
protected void btnSet_Click(object sender, EventArgs e)
{
AgentDataSource.SelectCommand = "SELECT * FROM [Table] WHERE [Col] BETWEEN " + txtFrom.Text + " AND " + txtTo.Text;
output.Attributes.CssStyle.Add("height", "300px");
gridAgents.Rebind();
}
Masterpage markup below:
<
body
>
<
table
id
=
"PageBody"
cellpadding
=
"0"
cellspacing
=
"0"
>
<
tr
>
<
td
id
=
"PageHeaderSideBar"
>
<
asp:Image
ID
=
"Image5"
runat
=
"server"
SkinID
=
"PageLogo"
CssClass
=
"PageLogo"
/>
</
td
>
<
td
id
=
"PageHeaderLeftSide"
>
<
asp:Image
ID
=
"Image1"
runat
=
"server"
SkinID
=
"Placeholder"
/>
</
td
>
<
td
id
=
"PageHeaderContent"
>
<
div
class
=
"Header"
>
<
asp:SiteMapPath
ID
=
"SiteMapPath1"
runat
=
"server"
SkinID
=
"SiteMapPath"
/>
<
div
class
=
"Title"
>
<
asp:ContentPlaceHolder
ID
=
"PageHeaderContentPlaceHolder"
runat
=
"server"
>
Page Title</
asp:ContentPlaceHolder
>
</
div
>
</
div
>
</
td
>
<
td
id
=
"PageHeaderRightSide"
>
<
asp:Image
ID
=
"Image2"
runat
=
"server"
SkinID
=
"Placeholder"
/>
</
td
>
</
tr
>
<
tr
>
<
td
id
=
"PageContentSideBar"
valign
=
"top"
>
<
div
class
=
"SideBarBody"
>
<
asp:ContentPlaceHolder
ID
=
"SideBarPlaceHolder"
runat
=
"server"
/>
<
asp:Image
runat
=
"server"
SkinID
=
"Placeholder"
/>
</
div
>
</
td
>
<
td
id
=
"PageContentLeftSide"
>
<
asp:Image
ID
=
"Image3"
runat
=
"server"
SkinID
=
"Placeholder"
/>
</
td
>
<
td
id
=
"PageContent"
valign
=
"top"
>
<
asp:ContentPlaceHolder
ID
=
"PageContentPlaceHolder"
runat
=
"server"
/>
</
td
>
<
td
id
=
"PageContentRightSide"
>
<
asp:Image
ID
=
"Image4"
runat
=
"server"
SkinID
=
"Placeholder"
/>
</
td
>
</
tr
>
<
tr
>
<
td
id
=
"PageFooterSideBar"
/>
<
td
id
=
"PageFooterLeftSide"
/>
<
td
id
=
"PageFooterContent"
/>
<
td
id
=
"PageFooterRightSide"
/>
</
tr
>
</
table
>
</
body
>