var telerikGrid = new RadGrid{ ID = "RadGrid1", DataSource = request.dataTable, AllowSorting = true, AllowPaging = true, Width = Unit.Pixel(980), AutoGenerateColumns = true, GridLines = GridLines.Both, Skin = ddlStyle.SelectedValue ?? "Black"};//telerikGrid.MasterTableView.TableLayout = GridTableLayout.Fixed;//ScrollingtelerikGrid.ClientSettings.Scrolling.AllowScroll = true;//telerikGrid.ClientSettings.Scrolling.SaveScrollPosition = true;telerikGrid.ClientSettings.Scrolling.UseStaticHeaders = true;telerikGrid.ClientSettings.Selecting.AllowRowSelect = true;telerikGrid.ClientSettings.Scrolling.FrozenColumnsCount = 1;//telerikGrid.ClientSettings.Scrolling.ScrollHeight = Unit.Percentage(100);telerikGrid.MasterTableView.VirtualItemCount = request.dataTable.Rows.Count;//telerikGrid.ClientSettings.Scrolling.ScrollHeight = Unit.Percentage()//ResizingtelerikGrid.ClientSettings.Resizing.AllowColumnResize = true;//ReorderingtelerikGrid.ClientSettings.AllowColumnsReorder = true;//ExporttelerikGrid.MasterTableView.CommandItemSettings.ShowExportToExcelButton = true;telerikGrid.MasterTableView.Visible = true;telerikGrid.MasterTableView.CommandItemDisplay = GridCommandItemDisplay.Top;telerikGrid.PagerStyle.Mode = GridPagerMode.NextPrevAndNumeric;This is my Radgrid
When I filter wiht 15/02/2012 --> does not return nothing.
I need SHOW DATE + HOUR, is important!
.. I try this
protected void ActivityLog_ItemCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == RadGrid.FilterCommandName)
{
Pair filterPair = e.CommandArgument as Pair;
string columnName = Convert.ToString(filterPair.Second);
if (columnName == "Date")
{
e.Canceled = true;
string date =
((RadDatePicker)((GridFilteringItem)e.Item)[Convert.ToString(filterPair.Second)].Controls[0])
.SelectedDate.ToString();
DateTime startDate = Convert.ToDateTime(date).AddDays(-1);
DateTime endDate = startDate.AddDays(2);
string newFilter = "('" + startDate.ToString("MM/dd/yyyy") + "' < [Date] AND [Date] < '" + endDate.ToString("MM/dd/yyyy") + "')";
GridBoundColumn dateColumn = (GridBoundColumn)e.Item.OwnerTableView.GetColumnSafe(columnName);
dateColumn.CurrentFilterValue = Convert.ToDateTime(date).ToString("MM/dd/yyyy");
ActivityLogGrid.MasterTableView.FilterExpression = newFilter;
ActivityLogGrid.Rebind();
}
}
}
But ReBind does not work.
I use:
- AutogenerateColumns = true
and NeedSource events.
regards
<telerik:RadNumericTextBox ID="txtDecisionNumber" runat="server" MaxLength="100"
CssClass="InnerTextStyle" Width="95%" Type="Number" MinValue="0" NumberFormat-DecimalDigits="0"
NumberFormat-GroupSeparator="" AllowOutOfRangeAutoCorrect="true" NumberFormat-KeepNotRoundedValue="false"
NumberFormat-AllowRounding="true">
<ClientEvents OnKeyPress="KeyPress" />
</telerik:RadNumericTextBox>
Thanks d Advance
Mr. Perfect
Hi,
I have a RadComboBox with a Header and Item Templates. I have set the EnableLoadOnDemand to true and using the OnItemsRequested event to populate the ComboBox. In the event am getting the values in a DataSet and using it as the datasource and binding it to the ComboBox using DataBind() method. But the data is not getting displayed and in the UI it is just showing the message as "Loading...". Am not even getting any exceptions and the datasource is being assigned properly. Am I missing something else?. Please help me in this regard. Thanks.
Below are the aspx and the script CS code i have written. Please find the attached screenshot as well.
<script type="text/C#" language="CS" runat="server"> protected void RadComboBox_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e) { try { SomeClass sclass = new SomeClass() DataSet ds = sclass.SomeMethod(); RadComboBox rcb = (RadComboBox)sender; rcb.DataSource = ds; rcb.DataTextField = "Column1"; rcb.DataValueField = "Column0"; rcb.DataBind(); } catch (Exception ex) { throw ex; } }</script>
<telerik:RadComboBox HighlightTemplatedItems="true" IsCaseSensitive="false" ID="ddlRadComboBox1" EnableLoadOnDemand="true" runat="server" TabIndex="9" OnItemsRequested="RadComboBox_ItemsRequested" style="width:30%;height:25px;" DropDownWidth="750"> <HeaderTemplate> <table style="width: 750px; font-family:Verdana; font-size:11px;" cellspacing="0" cellpadding="0"> <tr> <td style="width:35%;">Column 1</td> <td style="width:65%;">Column 2</td> </tr> </table> </HeaderTemplate> <ItemTemplate> <table style="width: 750px; font-family:Verdana; font-size:11px;" cellspacing="0" cellpadding="0"> <tr> <td style="width:35%;"><%# DataBinder.Eval(Container.DataItem, "Column1")%></td> <td style="width:65%;"><%# DataBinder.Eval(Container.DataItem, "Columns2")%></td> </tr> </table> </ItemTemplate> </telerik:RadComboBox>DataTextField
="ratecode;description" DataTextFormatString="{0} - {1}" DataValueField="rateid"