Private
Function
SomeTable()
As
DataTable
Dim
dt
As
New
DataTable()
dt.Columns.Add(
New
DataColumn(
"FieldName"
, Type.
GetType
(
"System.String"
)))
row(
"FieldName"
) =
"C:\SomeDirectory\RadGridExport.pdf"
dt.Rows.Add(row)
Return
dt
End
Function
<
telerik:GridAttachmentColumn
DataSourceID
=
"ObjectDataSource1"
HeaderText
=
"Attachment Column"
AttachmentKeyFields
=
"FieldName"
AttachmentDataField
=
"FieldName"
DataTextField
=
"FieldName"
UniqueName
=
"FieldName"
ButtonType
=
"ImageButton"
UploadControlType
=
"RadAsyncUpload"
FileName
=
"RadGridExport.pdf"
ImageUrl
=
"pdf-icon.png"
ItemStyle-Height
=
"36px"
ItemStyle-Width
=
"36px"
>
</
telerik:GridAttachmentColumn
>
<
asp:ObjectDataSource
ID
=
"ObjectDataSource1"
runat
=
"server"
SelectMethod
=
"MySelectMethod"
TypeName
=
"MyApp"
>
<
SelectParameters
>
<
asp:Parameter
Name
=
"FieldName"
Type
=
"String"
/>
</
SelectParameters
>
</
asp:ObjectDataSource
>
Public
Class
MyApp
<DataObjectMethodAttribute(DataObjectMethodType.
Select
,
True
)>
Public
Function
MySelectMethod(filePath
As
String
)
As
DataTable
Dim
dt
As
New
DataTable(
"Base"
)
Dim
col
As
New
DataColumn(
"FieldName"
)
col.DataType = System.Type.
GetType
(
"System.Byte[]"
)
dt.Columns.Add(col)
Dim
row
As
DataRow = dt.NewRow
row(0) = My.Computer.FileSystem.ReadAllBytes(filePath)
dt.Rows.Add(row)
Return
dt
End
Function
End
Class
<
telerik:RadGrid
ID
=
"RadGrid1"
runat
=
"server"
>
<
MasterTableView
>
<
Columns
>
<
telerik:GridClientDeleteColumn
CommandName
=
"Delete"
ButtonType
=
"LinkButton"
></
telerik:GridClientDeleteColumn
>
</
Columns
>
</
MasterTableView
>
<
ClientSettings
>
<
ClientEvents
OnCommand
=
"OnCommand"
/>
</
ClientSettings
>
</
telerik:RadGrid
>
function
OnCommand(sender, args) {
}
Provide a simple interface to showcase exactly in what order the columns have been sorted in (ex. 1, 2, 3, etc in column header) - matching the functionality in Kendo UI Grid: http://demos.telerik.com/kendo-ui/grid/sorting
For Bug Report : Note: We are using MM/dd/yyyy as Internal Date format to prevent issue while inserting or updating value. Steps to reproduce: When we use dd-MM-yyyy and yyyy-dd-MM Date DisplayFformat for RadDatePicker/RadDateTimePicker control as well as view mode in Radgrid Batch Edit mode it's render behaviour is inconsistent 1. When dd is less than or equal to 12 then while rendering in edit mode Month and Date is interchanged 2. When dd is greather than 12 then while rendering in edit mode Month and Date is rendered correctly.
You would get something like (([createddate] >= '01/08/2017,00:00:00') AND ([createddate] <= '14/08/2017,23:59:59')) while you should get something like (([createddate] >= '01/08/2017 00:00:00') AND ([createddate] <= '14/08/2017 23:59:59')) so that the SQL syntax is valid. RadGrid, does not send the FilterExpression to the SqlDataSource, however. It executes the SELECT statement and then filters the resulting data on its own. This works fine. If you will be performing operations yourself, you could use a string operation before passing the filter expression. For example: protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e) { if (!string.IsNullOrEmpty(this.RadGrid1.MasterTableView.FilterExpression)) { if (this.RadGrid1.MasterTableView.FilterExpression.Contains("createddate")) { this.RadGrid1.MasterTableView.FilterExpression = this.RadGrid1.MasterTableView.FilterExpression.Replace(",", " "); } DataView dv =GetData("select * from [myTable] where ", this.RadGrid1.MasterTableView.FilterExpression); //where you would need to have something like (([createddate] >= '01/08/2017 00:00:00') AND ([createddate] <= '14/08/2017 23:59:59')) this.RadGrid1.DataSource = dv; } } Note that implementing such a change may break existing code that relies on the current syntax that contains the comma.
If the selection mode of the Grid is different than row selection, no cell of the detailed grid gets selected. The bug is introduced with version 2016 R3 SP1 Steps to reproduce: 1. Run the following demo locally http://demos.telerik.com/aspnet-ajax/grid/examples/hierarchy/declarative-relations/defaultcs.aspx 2. and add this configuration: <telerik:RadGrid ...> <ClientSettings> <Selecting CellSelectionMode="SingleCell" /> </ClientSettings>
To overcome this issue you can do the following: - For anchor links (a) implement onclick event with window.location. - For submit buttons set UseSubmitBehavior property to false.
Th header context menu of the Grid gets closed on click (select/deselect a column) if the Grid is initially scrolled horizontally. Video: https://www.screencast.com/t/Gm1FLHia Steps to reproduce: 1. Open the Live Demos solution for "UI for ASP.NET AJAX R1 2017" in VS2015; 2. Open the page "UI for ASP.NET AJAX R1 2017\Live Demos\Grid\Examples\Functionality\Scrolling\scrolling\DefaultCS.aspx"; 3. Enable the HeaderContextMenu by setting EnableHeaderContextMenu="True" in the tag telerik:RadGrid; 4. Disable the column freezing. 5. Run the Demo and open the page "Grid\Examples\Functionality\Scrolling\scrolling\DefaultCS.aspx"; 6. Scroll the horizontal scrollbar of the grid to the right; 7. Right click on the column header and pick the Columns from the context menu; 8. Select or unselect any column, the Column Chooser will close by itself; 9. Now, scroll the horizontal scrollbar of the grid all the way to the left; 10. Right click on the column header and pick the Column Chooser from the context menu; 11. Select or unselect any columns, the Column Chooser won't close by itself.
Workaround for the NextPrevAndNumeric mode is to set the AssociatedControlID of the label protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e) { if (e.Item is GridPagerItem) { GridPagerItem pager = e.Item as GridPagerItem; Label lbl = pager.FindControl("ChangePageSizeLabel") as Label; Panel pnl = lbl.Parent as Panel; RadComboBox combo = pnl.FindControl("PageSizeComboBox") as RadComboBox; lbl.AssociatedControlID = combo.ID; } } <telerik:RadGrid RenderMode="Lightweight" ID="RadGrid1" runat="server" DataSourceID="SqlDataSource1" AllowSorting="True" AllowPaging="True" GridLines="None" Width="100%" OnItemDataBound="RadGrid1_ItemDataBound"> <PagerStyle Mode="NextPrevAndNumeric" Position="TopAndBottom" PageSizeControlType="RadComboBox"></PagerStyle> </telerik:RadGrid> <asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:NorthwindConnectionString %>" ProviderName="System.Data.SqlClient" SelectCommand="SELECT CustomerID, CompanyName, ContactName, ContactTitle, Address, PostalCode FROM Customers" runat="server"></asp:SqlDataSource>
If the Page culture is set to anything other than "en-US", RadDatePicker in the HeaderContextMenu will loose the correct format and swaps the Day with the Month after filtering.
Expected: the row disappears.
Actual result: nothing happens.