<MasterTableView DataSourceID="SqlDataSource1" DataKeyNames="EmployeeID" AllowMultiColumnSorting="True" |
GroupLoadMode="Server"> |
<NestedViewTemplate> |
<asp:Panel runat="server" ID="InnerContainer" CssClass="viewWrap" Visible="false"> |
<telerik:RadTabStrip runat="server" ID="TabStip1" MultiPageID="Multipage1" |
SelectedIndex="0"> |
<Tabs> |
<telerik:RadTab runat="server" Text="Sales" PageViewID="PageView1"> |
</telerik:RadTab> |
<telerik:RadTab runat="server" Text="Contact Information" PageViewID="PageView2"> |
</telerik:RadTab> |
<telerik:RadTab runat="server" Text="Statistics Chart" PageViewID="PageView3"> |
</telerik:RadTab> |
</Tabs> |
</telerik:RadTabStrip> |
<telerik:RadMultiPage runat="server" ID="Multipage1" SelectedIndex="0" RenderSelectedPageOnly="false"> |
<telerik:RadPageView runat="server" ID="PageView1"> |
<asp:Label ID="Label1" Font-Bold="true" Font-Italic="true" Text='<%# Eval("EmployeeID") %>' |
Visible="false" runat="server" /> |
<telerik:RadGrid runat="server" ID="OrdersGrid" DataSourceID="SqlDataSource2" |
ShowFooter="true" AllowSorting="true" EnableLinqExpressions="false"> |
<MasterTableView ShowHeader="true" AutoGenerateColumns="False" AllowPaging="true" |
DataKeyNames="OrderID" PageSize="7" HierarchyLoadMode="ServerOnDemand"> |
<asp:Button ID="btnUpdate" |
Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update"%>' |
runat="server" |
CommandName='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' |
onclick="btnUpdate_Click"/> |
protected void btnUpdate_Click(object sender, EventArgs e) |
{ |
if (btnUpdate.Text == "Update") |
{ |
//This works swimmingly with the bindings from the form |
} |
if (btnUpdate.Text == "Insert") |
{ |
//This doesn't work because I can't pass the datakey that is in the label. Using the insert command button on the grid clears the data sent to the form. |
} |
} |
Hi, I'm having troubles removing a blank row in my export file (See example1);
The only thing I have between the rows is an "EditItemTemplate" where I update the row.(check example2).
Is that what's causing it?
My export code:
gridOrdenes.ExportSettings.IgnorePaging = true;
gridOrdenes.ExportSettings.ExportOnlyData = true;
gridOrdenes.ExportSettings.OpenInNewWindow = true;
gridOrdenes.ExportSettings.HideStructureColumns = true;
gridOrdenes.MasterTableView.ExportToExcel();
I have been struggling to get the callback function to be recognized. My situation is that I have a javascript function that executes when a user clicks a button. This function contains code similar to the following to open the radconfirm prompt window
var oManager = GetRadWindowManager();
oManager.radconfirm(pMsg, "returnFunction",400,300,"Popup Title");
When the user clickes either the Ok or Cancel button the following error occurs.
JavaScript runtime error: Function expected
The function returnFunction(arg) exsits in the same javascript file but is not recognized.
Any ideas as to the issue.
I would like to be able to remove formatting when pasting into the spreadsheet control. I have followed the recommendation on this article.
https://docs.telerik.com/devtools/aspnet-ajax/controls/spreadsheet/how-to/pasting-data-only
However, this._content is always undefined.
What am I missing? I am using version 2016.2.607.45
<
telerik:GridHyperLinkColumn
UniqueName
=
"MemoColumn"
ImageUrl
=
"Content/Images/memo16.png"
Target
=
"_blank"
HeaderImageUrl
=
"Content/Images/memo16.png"
HeaderButtonType
=
"LinkButton"
>
<
ItemStyle
HorizontalAlign
=
"Center"
Width
=
"3%"
Wrap
=
"false"
/>
<
HeaderStyle
HorizontalAlign
=
"Center"
Width
=
"3%"
/>
</
telerik:GridHyperLinkColumn
>
I have a link button in my RadGrid. When I clicked the link button,it will pop out a new page. All is working fine without error. Here is my code:
<
telerik:RadGrid
ID
=
"gvCustomer"
runat
=
"server"
AllowPaging
=
"True"
AllowSorting
=
"True"
AutoGenerateColumns
=
"False"
CellSpacing
=
"0"
GridLines
=
"None"
Width
=
"100%"
>
<
MasterTableView
AllowMultiColumnSorting
=
"True"
>
<
CommandItemSettings
ExportToPdfText
=
"Export to PDF"
/>
<
RowIndicatorColumn
FilterControlAltText
=
"Filter RowIndicator column"
Visible
=
"True"
>
</
RowIndicatorColumn
>
<
ExpandCollapseColumn
FilterControlAltText
=
"Filter ExpandColumn column"
Visible
=
"True"
>
</
ExpandCollapseColumn
>
<
Columns
>
<
telerik:GridTemplateColumn
FilterControlAltText
=
"Filter TemplateColumn column"
HeaderText
=
"Customer Name"
SortExpression
=
"CUSTOMERNAME"
UniqueName
=
"TemplateColumn"
>
<
ItemTemplate
>
<
asp:LinkButton
ID
=
"lnkCustomerName"
runat
=
"server"
CommandArgument='<%#Eval("CUSTOMERNAME") "," +Eval("IC")+ "," +Eval("ACCNO")%>'
CommandName="command" Font-Underline="True" Text='<%# Bind("CUSTOMERNAME") %>'>
</
asp:LinkButton
>
</
ItemTemplate
>
<
FooterStyle
HorizontalAlign
=
"Center"
/>
<
HeaderStyle
Width
=
"25%"
/>
<
ItemStyle
HorizontalAlign
=
"Left"
VerticalAlign
=
"Top"
/>
</
telerik:GridTemplateColumn
>
</
Columns
>
<
EditFormSettings
>
<
EditColumn
FilterControlAltText
=
"Filter EditCommandColumn column"
>
</
EditColumn
>
</
EditFormSettings
>
<
PagerStyle
AlwaysVisible
=
"True"
/>
</
MasterTableView
>
<
HeaderStyle
HorizontalAlign
=
"Center"
/>
<
PagerStyle
AlwaysVisible
=
"True"
/>
<
FilterMenu
EnableImageSprites
=
"False"
>
</
FilterMenu
>
</
telerik:RadGrid
>
Protected
Sub
gvCustomer_ItemCommand(
ByVal
sender
As
Object
,
ByVal
e
As
Telerik.Web.UI.GridCommandEventArgs)
Handles
gvCustomer.ItemCommand
If
e.CommandName =
"command"
Then
Dim
arg
As
String
() = e.CommandArgument.ToString.Split(
","
)
Dim
strName
As
String
= arg(1)
Dim
strIC
As
String
= arg(2)
Dim
strAccountNo
As
String
= arg(3)
Dim
str
As
String
str =
"<script language='javascript'>window.open(' "
+
"~/Customer.aspx?CustomerName="
& strName &
"&OldIC="
& strIC &
"&AccountNo="
& strAccountNo +
" ');</script>"
ClientScript.RegisterStartupScript(
Me
.
GetType
(),
"script"
, str)
End
If
End
Sub
But after I added the RadAjaxManager to handle the RadGrid. The link button is not working anymore. The new page does not pop out. But if I remove the ajax manager will work fine,the page is post back and new page is pop out. Below is the code I added:
<
telerik:RadAjaxManager
ID
=
"RadAjaxManager1"
runat
=
"server"
DefaultLoadingPanelID
=
"RadAjaxLoadingPanel1"
>
<
AjaxSettings
>
<
telerik:AjaxSetting
AjaxControlID
=
"gvCustomer"
>
<
UpdatedControls
>
<
telerik:AjaxUpdatedControl
ControlID
=
"gvCustomer"
/>
</
UpdatedControls
>
</
telerik:AjaxSetting
>
</
AjaxSettings
>
</
telerik:RadAjaxManager
>
I have implemented RadGrid in my project for displaying data. But facing one severe issue, when trying to post back or going to the next page, the pager control is shifting down. In order to fix Grid height and width according to the page height and width, i have implemented bellow java script in page load. But unfortunately after post back it is not working.
var grid, gridHeight;
gridHeight = document.documentElement.offsetHeight - 130;
grid = $find('<%= GridControl1.FindControl("RadGrid4").ClientID %>');
if(grid !== null){
contentPane.set_height(document.documentElement.offsetHeight - 90);
grid.get_element().style.height = gridHeight+ "px";
contentSplitter.repaint();
grid.repaint();
}
else{
contentPane.set_height(document.documentElement.offsetHeight - 75);
}
Kindly suggest, how to fix Grid height in post back so that pager control should not shift down or disappear.
Thanks in advance.
Dipak
Hi,
We are currently evaluating the use of radgrids inside a radwizard to create a wizard that needs to collect validated data during entry in tables and that needs to send the collected info to a process at the last page of the wizard (classic behavior).
The idea seems mainstream but the use of grids and grids inside a wizard is not so easy.
Here is some problems we are facing:
1)We use fully client side radgrids: their initial data is populated by passing them empty lists of objects as a DataSource.
Rows can then be added manually using a button which triggers a 'fireCommand("InitInsert", "")'.
The users can batch edit the cells.
Can your please provide a working exemple of a RadGrid properly set up to be used fully client side and of the proper way to get its client values?
2)We tried setting ClientDataKeyNames to get the RadGrids data more easily: manually created rows with InitInsert, even when data has been entered manually, always provide empty values using getDataKeyValue("xxx") on the row.
Which is understandable as no data is actually bound.
How to properly get data from a RadGrid which is used this way?
As for now, we get the cells with js and search them for values. :(
3)Rows can also be added programmatically. Rows containGridTemplateColumns with DropDownList EditItemTemplate: How to programmatically set a RadDropDownList value in a client side RadGrid?
<telerik:GridTemplateColumn UniqueName="UserLanguage" SortExpression="UserLanguage" HeaderText="UserLanguage" DataField="UserLanguage" ShowFilterIcon="false"
EditFormColumnIndex="4" ColumnEditorID="CompanyListColumnEditor">
<HeaderStyle Width="50px" />
<ItemTemplate>
<%#DataBinder.Eval(Container.DataItem, "UserLanguage")%>
</ItemTemplate>
<EditItemTemplate>
<telerik:RadDropDownList RenderMode="Lightweight" ID="UserLangDD1" runat="server" Width="200px">
<Items>
<telerik:DropDownListItem Value="0" />
<telerik:DropDownListItem Value="F" Text="Français" />
<telerik:DropDownListItem Value="E" Text="English" />
</Items>
</telerik:RadDropDownList>
</EditItemTemplate>
</telerik:GridTemplateColumn>
I guess the problem resides in DataBinder.Eval() as no data is actually bound to the grid.
We tried setting UserLanguage with the display value ("Français" or "English") which does not work.
We tried to set UserLangDD1 with the Value (F or E) which does not work either.
4) The radWizard's Steps contain also other controls which are part of a validation group for each Step.
The validation works for these controls but does not apply to the fields of the rows which have been added to the Radgrids, despite these Column have as well Validators referencing the same ValidationGroup as the controls outside the Grids.
How to make a RadWizardStep apply RequiredFieldValidator on Grid Columns of RadGrids that it contains?
5) In a RadGrid, how not to block the user to getting out of a cell containing a Required control which has not yet been filled?
Currently, when a required control of a grid is not filled, it is forbidden to edit another control of these row, is there a workaround?
6) How to properly make a batch editable GridBoundColumn launch a popup (or equivalent) with a list of checkboxes as potential values and disallow users to actually write in this cell?
Any direction will be highly appreciated!