When EnableAriaSupport is enabled for the RadGrid, the PagerItem receives role='presentation' and hence is ignored by the screenreaders.
Resizing a column in the Grid Leads to resizing of the Grid wrapper along with the GroupPanel. The problem can be replicated with the following Resizing settings:
<Resizing AllowColumnResize="true" AllowRowResize="true" EnableRealTimeResize="true" ResizeGridOnColumnResize="false" EnableNextColumnResize="true"/>
The issue occurs only on certain Screen sizes, or when the browser/display has some zoom applied.
Hi,
I have a grid with detail tables. When the user expands an entry in the parent table, the child table data gets populated via the DetailTableDataBind event. That's all working properly when things go right. I'm trying to implement something to address when the detail data retrieval fails.
I've tried setting Cancelled = true in the GridDetailTableBindEventArgs parameter, but that appears to do nothing.
What's even more strange is that if I don't set the value of DetailTableView.DataSource, or I set it to nothing, the value of DetailTableView.DataSource takes on the value of the parent item datasource. That produces an exception because the parent table doesn't have the columns specified in the detail table DataKeyNames property. If I clear the DataKeyNames, I can prevent the exception. But then the child grid shows the parent grid records.
The following is a sample DetailTableDataBind Event: What can I do to either prevent the parent item from opening, show an empty child item, etc?
Protected Sub rgGrid_DetailTableDataBind(sender As Object, e As GridDetailTableDataBindEventArgs) Handles rgErrorGrid.DetailTableDataBind
Select Case e.DetailTableView.Name
Case "DetailTableName"
Dim dataItem As GridDataItem = TryCast(e.DetailTableView.ParentItem, GridDataItem)
Dim KeyVal As Integer
Dim dt As DataTable = Nothing
If Integer.TryParse(dataItem.GetDataKeyValue("ID").ToString(), KeyVal) Then
dt = GetDetailTable(KeyVal)
End If
If dt Is Nothing Then
' What do I need to do here to either prevent the parent item from expanding, or show an empty grid...without throwing an exception?
e.DetailTableView.DataSource = Nothing
e.Canceled = True
Else
e.DetailTableView.DataSource = dt
End If
End Select
End Sub
The submenu with filtering options has elements that overflow the sliding element:
It would be good to add this functionality for a better customization of the Grid's newly inserted rows.
Upon inserting a new record after filtering on the Grid with No records, the exception "No property or field 'Name' exists in type 'DataRowView'" is thrown.
Steps to reproduce:
Code to replicate the issue:
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" AllowFilteringByColumn="true"
OnNeedDataSource="RadGrid1_NeedDataSource" OnInsertCommand="RadGrid1_InsertCommand">
<MasterTableView CommandItemDisplay="Top" DataKeyNames="ID">
<Columns>
<telerik:GridEditCommandColumn></telerik:GridEditCommandColumn>
<telerik:GridButtonColumn CommandName="Delete"></telerik:GridButtonColumn>
<telerik:GridBoundColumn DataField="ID" HeaderText="ID" UniqueName="ID" ReadOnly="true"
CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
<telerik:GridBoundColumn DataField="Name" HeaderText="Name" UniqueName="Name"
AutoPostBackOnFilter="false" />
<telerik:GridBoundColumn DataField="Category" HeaderText="Category" UniqueName="Category" DataType="System.String"
CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" />
<telerik:GridBoundColumn DataField="Price" HeaderText="Price" UniqueName="Price"
CurrentFilterFunction="Contains" AutoPostBackOnFilter="true" DataFormatString="{0:C}" />
</Columns>
<EditFormSettings InsertCaption="Add New Item" />
</MasterTableView>
</telerik:RadGrid>
C#
private const string DataTableSessionKey = "RadGridDataTable";
private DataTable SessionDataSource
{
get
{
DataTable dt = Session[DataTableSessionKey] as DataTable;
if (dt == null || !IsPostBack)
{
// Create an empty DataTable with schema defined
dt = new DataTable();
dt.Columns.Add("ID", typeof(int));
dt.Columns.Add("Name", typeof(string));
dt.Columns.Add("Category", typeof(string));
dt.Columns.Add("Price", typeof(decimal));
dt.PrimaryKey = new DataColumn[] { dt.Columns["ID"] };
Session[DataTableSessionKey] = dt;
}
return dt;
}
}
protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
{
(sender as RadGrid).DataSource = SessionDataSource;
}
protected void RadGrid1_InsertCommand(object sender, GridCommandEventArgs e)
{
GridEditableItem insertItem = (GridEditableItem) e.Item;
Hashtable newValues = new Hashtable();
insertItem.ExtractValues(newValues);
DataRow findLastItem = SessionDataSource.Select("ID=MAX(ID)").FirstOrDefault();
newValues["ID"] = findLastItem != null ? (int) findLastItem["ID"] + 1 : 0;
DataRow rowToInsert = SessionDataSource.NewRow();
foreach (DictionaryEntry entry in newValues)
{
rowToInsert[entry.Key.ToString()] = entry.Value ?? DBNull.Value;
}
SessionDataSource.Rows.Add(rowToInsert);
}
While filtering in Radgrid column and using special character "%" it is not searching using "%", simply searching by other text. Suppose we are filtering using "30%", but the results are shown as it is only 30. While debugging I found out that the used sql query becomes like following like '%30%%' In this the percentage symbol just after 30 is the symbol passed from UI but query considers as if we are looking for 30.
hi, I have radgrid ,its showing two others column but in database view its only exists, Bold column not exists in view. I attached output of radgrid. View's Column --------------------- ,[StartDate] ,[EndDate] ,[DepartmentName] ,[LabourRate] ,[BillingRate] ,[AgencyRate] ,[FirstName] ,[LastName] ,[Description] ,[ManagerFirst] ,[ManagerLast] ,[WeekEnding] ,[Hours] ,[RateType] ,[TimesheetStatus] ,[TimesheetID] --------------------- <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server"> <h1>Current Contractors</h1> <br/> <telerik:RadButton ID="RadButton1" runat="server" onclick="RadButton1_Click" Text="Previous"> </telerik:RadButton> <telerik:RadButton ID="RadButton2" runat="server" onclick="RadButton2_Click" Text="Next"> </telerik:RadButton> <br/> <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" CellSpacing="0" DataSourceID="ObjectDataSource1" GridLines="None" AllowFilteringByColumn="True" AllowPaging="True" AllowSorting="True" ExportSettings-FileName="Payroll Report" ExportSettings-ExportOnlyData="False" ExportSettings-HideStructureColumns="True" ExportSettings-IgnorePaging="True" ExportSettings-OpenInNewWindow="True" > <MasterTableView DataKeyNames="Name,StartDate,EndDate,DepartmentName,LabourRate,FirstName,LastName,Description,ManagerFirst,ManagerLast,WeekEnding,RateType,TimesheetStatus" DataSourceID="ObjectDataSource1" CommandItemDisplay="Top" CommandItemSettings-ShowExportToCsvButton="True" CommandItemSettings-ShowExportToExcelButton="True" CommandItemSettings-ShowExportToPdfButton="True" CommandItemSettings-ShowExportToWordButton="True" CommandItemSettings-ShowAddNewRecordButton="False" CommandItemSettings-ShowRefreshButton="False" CommandItemStyle-HorizontalAlign="Left" > <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings> <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"> <HeaderStyle Width="20px"></HeaderStyle> </RowIndicatorColumn> <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"> <HeaderStyle Width="20px"></HeaderStyle> </ExpandCollapseColumn> <Columns> <telerik:GridBoundColumn DataField="ContractorName" FilterControlWidth="20px" FilterControlAltText="Filter ContractorName column" HeaderText="Contractor" ReadOnly="True" SortExpression="FirstName" UniqueName="ContractorName" > </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Description" FilterControlAltText="Filter Description column" HeaderText="Job" FilterControlWidth="20px" ReadOnly="True" SortExpression="Description" UniqueName="Description"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="ManagerName" FilterControlAltText="Filter ManagerName column" HeaderText="Manager" FilterControlWidth="20px" ReadOnly="True" SortExpression="ManagerFirst" UniqueName="ManagerName" > </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="AgencyRate" DataType="System.Decimal" FilterControlWidth="20px" DataFormatString="{0:C}" FilterControlAltText="Filter AgencyRate column" HeaderText="Agency Rate" SortExpression="AgencyRate" UniqueName="AgencyRate"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="LabourRate" DataType="System.Decimal" FilterControlWidth="20px" DataFormatString="{0:C}" FilterControlAltText="Filter LabourRate column" HeaderText="Labour Rate" ReadOnly="True" SortExpression="LabourRate" UniqueName="LabourRate"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="BillingRate" DataType="System.Decimal" FilterControlWidth="20px" DataFormatString="{0:C}" FilterControlAltText="Filter BillingRate column" HeaderText="Billing Rate" SortExpression="BillingRate" UniqueName="BillingRate"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="StartDate" DataType="System.DateTime" FilterControlWidth="20px" DataFormatString="{0:dd/MM/yyyy}" FilterControlAltText="Filter StartDate column" HeaderText="Start" ReadOnly="True" SortExpression="StartDate" UniqueName="StartDate"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="DepartmentName" FilterControlAltText="Filter DepartmentName column" HeaderText="Department" FilterControlWidth="20px" ReadOnly="True" SortExpression="DepartmentName" UniqueName="DepartmentName" > </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Name" FilterControlWidth="20px" FilterControlAltText="Filter Name column" HeaderText="Name" ReadOnly="True" SortExpression="Name" UniqueName="Name" > </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="Hours" DataType="System.Int32" FilterControlWidth="20px" FilterControlAltText="Filter Hours column" HeaderText="Hours" SortExpression="Hours" UniqueName="Hours"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="RateType" FilterControlWidth="20px" FilterControlAltText="Filter RateType column" HeaderText="RateType" ReadOnly="True" SortExpression="RateType" UniqueName="RateType"> </telerik:GridBoundColumn> <telerik:GridBoundColumn DataField="TimesheetStatus" FilterControlWidth="20px" FilterControlAltText="Filter TimesheetStatus column" HeaderText="Status" ReadOnly="True" SortExpression="TimesheetStatus" UniqueName="TimesheetStatus"> </telerik:GridBoundColumn> </Columns> <EditFormSettings> <EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn> </EditFormSettings> </MasterTableView> <FilterMenu EnableImageSprites="False"></FilterMenu> </telerik:RadGrid> <asp:ObjectDataSource ID="ObjectDataSource1" runat="server" SelectMethod="GetPayrollReport" TypeName="Business.PayrollReportList" SortParameterName="sortBy" > <SelectParameters> <asp:SessionParameter SessionField="WeekEnding" DbType="DateTime" Name="WeekEnding" /> </SelectParameters> </asp:ObjectDataSource> </asp:Content>
Using Web.UI v2011.1.315.35 How can I count only non-blank items in the group Screenshots attached using the built-in and custom aggregates, also the custom-aggregation event handler code attached.
RadGrid row height is not calculated correctly after postback
I would like to suggest the ability to turn on/off a plus/minus icon that can appear in the grid header in order to expand all or collapse all. This is one of those things that is not very difficult for people to code on their own, but it seems like a basic feature of a grid that can have child detail data. I'd rather be able to set a boolean property through code or in my theme .skin file for the grid, and have it turned on for me. It should function no matter what the HierarchyLoadMode is set to, but when set to "Client", the expand/collapse should all happen on the client. Thanks!
1. create a rad grid with clientside binding and a clientdeletecolumn. clientdelete column is buttontype=linkbutton and the linkbutton has a class for a background image 2. set allowpaging="false" but don't set a page size 3. populate grid so that it has 10 records 4. all client delete buttons are visible 5. add more records so that there are > 10 records 6. records from 11>n will not show the clientdeletecolumn 7. now, up the page size to something greater than your record count 8. problem fixed on viewing source you can see that the rgNoRecords tr is inserted after record 10 (default page size), which seems to affect the rendering below. the actual links for the client side delete columns are not rendered