Showmoreresults button(The arrow below the dropdown) is displaying value twice in a combobox.
The same issue is present in the following example as well.
http://demos.telerik.com/ASPNET/Prometheus/Combobox/Examples/PopulatingWithData/AutoCompleteSql/DefaultCS.aspx
If we select some value for example 'Berglunds snabbköp' from the dropdown. After clicking on Select button one value is present in the dropdown which is correct. Now if Showmoreresults button is clicked it will display the above value twice in dropdown.
Could you please tell some way of resoving this issue?
Also the EnableVirtualScrolling="true" is not working first time. After clicking on the Showmoreresults button or on writing something in the textbox eventually scroll starts working i.e. is populating data.
Any help would be highly appreciated.
| <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %> |
| <%@ Register Namespace="MyStuff" TagPrefix="custom" %> |
| <%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %> |
| <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> |
| <html xmlns="http://www.w3.org/1999/xhtml" > |
| <head runat="server"> |
| <title>Untitled Page</title> |
| <telerik:RadCodeBlock ID="RadCodeBlock1" runat="server"> |
| <script type="text/javascript"> |
| <!-- |
| function HandleScrolling(e) |
| { |
| var grid = $find("<%=RadGrid1.ClientID %>"); |
| var scrollArea = document.getElementById("<%= RadGrid1.ClientID %>" + "_GridData"); |
| if(IsScrolledToBottom(scrollArea)) |
| { |
| var currentlyDisplayedRecords = grid.get_masterTableView().get_pageSize() * (grid.get_masterTableView().get_currentPageIndex() + 1); |
| //if the presently visible items are less than the entire source records count |
| //trigger an ajax request to increase them |
| if(currentlyDisplayedRecords < 100) |
| { |
| $find("<%= RadAjaxManager1.ClientID %>").ajaxRequest("LoadMoreRecords"); |
| } |
| } |
| } |
| //this method calculates whether you have reached the bottom when dragging the vertical grid scroll |
| function IsScrolledToBottom(scrollArea) |
| { |
| var currentPosition = scrollArea.scrollTop + scrollArea.clientHeight; |
| return currentPosition == scrollArea.scrollHeight; |
| } |
| function GetSelectedItems() |
| { |
| alert($find("<%= RadGrid1.MasterTableView.ClientID %>").get_selectedItems().length); |
| } |
| function OnClientItemsRequesting(sender, args) |
| { |
| if(sender.GetText().length < 1) |
| { |
| return false; |
| } |
| else |
| { |
| sender.ClearItems(); |
| } |
| } |
| --> |
| </script> |
| </telerik:RadCodeBlock> |
| </head> |
| <body> |
| <form id="form1" runat="server"> |
| <telerik:RadScriptManager ID="RadScriptManager1" runat="server"> |
| </telerik:RadScriptManager> |
| <div> |
| <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server"> |
| <AjaxSettings> |
| <telerik:AjaxSetting AjaxControlID="RadGrid1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel1"/> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| <telerik:AjaxSetting AjaxControlID="RadAjaxManager1"> |
| <UpdatedControls> |
| <telerik:AjaxUpdatedControl ControlID="RadGrid1" LoadingPanelID="RadAjaxLoadingPanel2"/> |
| </UpdatedControls> |
| </telerik:AjaxSetting> |
| </AjaxSettings> |
| </telerik:RadAjaxManager> |
| <table width="100%" border="0"> |
| <tr> |
| <td style="width:100%;"> |
| <table width="100%"> |
| <tr> |
| <td> |
| <asp:Label ID="Label1" runat="server" Text="Worklist Type"></asp:Label> |
| </td> |
| <td> |
| <telerik:RadComboBox ID="RadComboBox1" runat="server" AutoPostBack="True" OnSelectedIndexChanged="RadComboBox1_SelectedIndexChanged" |
| Skin="Black"> |
| <Items> |
| <telerik:RadComboBoxItem runat="server" Text="Some Value 1" Value="1" /> |
| <telerik:RadComboBoxItem runat="server" Text="Some Value 6" |
| Value="6" /> |
| </Items> |
| <CollapseAnimation Duration="200" Type="OutQuint" /> |
| </telerik:RadComboBox> |
| </td> |
| <td> |
| Location</td> |
| <td> |
| <telerik:RadComboBox ID="RadComboBox2" runat="server" Skin="Sunset"> |
| <Items> |
| <telerik:RadComboBoxItem runat="server" Text="College" Value="COL" /> |
| </Items> |
| <CollapseAnimation Duration="200" Type="OutQuint" /> |
| </telerik:RadComboBox> |
| </td> |
| </tr> |
| </table> |
| </td> |
| </tr> |
| <tr> |
| <td style="width:100%;"> |
| <telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" runat="server" Height="75px" Width="75px" Transparency="25" > |
| <img alt="Loading..." src='<%= RadAjaxLoadingPanel.GetWebResourceUrl(Page, "Telerik.Web.UI.Skins.Default.Ajax.loading.gif") %>' style="border:0;" /> |
| </telerik:RadAjaxLoadingPanel> |
| <telerik:RadGrid ID="RadGrid1" runat="server" AllowFilteringByColumn="True" |
| AllowSorting="True" |
| AllowPaging="true" |
| ShowFooter="true" |
| DataSourceID="SqlDataSource1" |
| PageSize="100" |
| Skin="Web20" |
| width="100%" |
| OnItemCommand="RadGrid1_ItemCommand" |
| AutoGenerateColumns="False" |
| VirtualItemCount="10000" |
| OnColumnCreating="RadGrid1_ColumnCreating" |
| OnNeedDataSource="RadGrid1_NeedDataSource"> |
| <ClientSettings AllowKeyboardNavigation="true"> |
| <Scrolling AllowScroll="True" EnableVirtualScrollPaging="True" UseStaticHeaders="True"> |
| </Scrolling> |
| <ClientEvents OnScroll="HandleScrolling" /> |
| <Selecting AllowRowSelect="True" /> |
| </ClientSettings> |
| <SortingSettings SortedBackColor="BurlyWood" /> |
| <MasterTableView AllowNaturalSort="False" AllowSorting="False" DataKeyNames="Patient_id" DataSourceID="SqlDataSource1" > |
| <RowIndicatorColumn> |
| <HeaderStyle Width="20px" /> |
| </RowIndicatorColumn> |
| <ExpandCollapseColumn> |
| <HeaderStyle Width="20px" /> |
| </ExpandCollapseColumn> |
| <Columns> |
| <custom:MyCustomFilteringColumn UniqueName="Title" DataField="Title" EmptyDataText="&nbsp;" HeaderText="Title" |
| AllowFiltering="False" SortExpression="Title" > |
| </custom:MyCustomFilteringColumn> |
| <custom:MyCustomFilteringColumn UniqueName="Fname" DataField="Fname" EmptyDataText="&nbsp;" HeaderText="Fname" |
| SortExpression="Fname"> |
| </custom:MyCustomFilteringColumn> |
| <custom:MyCustomFilteringColumn UniqueName="Mname" DataField="Mname" EmptyDataText="&nbsp;" HeaderText="Mname" |
| SortExpression="Mname"> |
| </custom:MyCustomFilteringColumn> |
| <custom:MyCustomFilteringColumn UniqueName="Sname" DataField="Sname" EmptyDataText="&nbsp;" HeaderText="Sname" |
| SortExpression="Sname"> |
| </custom:MyCustomFilteringColumn> |
| </Columns> |
| </MasterTableView> |
| <HeaderStyle Width="200px" /> |
| <PagerStyle Mode="Slider" /> |
| <SelectedItemStyle BackColor="#FFC0C0" /> |
| <FilterMenu EnableTheming="True" Skin="Vista"> |
| <CollapseAnimation Duration="200" Type="OutQuint" /> |
| </FilterMenu> |
| </telerik:RadGrid> |
| </td> |
| </tr> |
| </table> |
| <asp:Button ID="clrFilters" runat="server" Text="Clear filters" CssClass="button" |
| OnClick="clrFilters_Click"></asp:Button> |
| </div> |
| </form> |
| </body> |
| </html> |
Hello,
I am binding a datatable to my rad tree view and depending on the node's level, get it to call a javascript function when it is click, along with doing the normal post back call.
Many thanks for help provided.
Richard
MasterTable_Office2007 and
GridRow_Office2007
| protected void Page_Load(object sender, EventArgs e) |
| { |
| if (!Page.IsPostBack) |
| { |
| ...... |
| ...... |
| ...... |
| ltCallbackAttributeGrid.Text = ClientScript.GetCallbackEventReference(this, |
| "'bindAttr'", "EndGetData2", "'asyncgrid2'", false); |
| } |
| } |
| #region ICallbackEventHandler Members |
| private string _callBack; |
| public string GetCallbackResult() |
| { |
| return _callBack; |
| } |
| public void RaiseCallbackEvent(string eventArgument) |
| { |
| grdAttributes.DataSource = _additionalAttributeColumns; |
| grdAttributes.DataBind(); |
| using (StringWriter sw = new StringWriter()) |
| { |
| grdAttributes.RenderControl(new HtmlTextWriter(sw)); |
| _callBack = sw.ToString(); |
| } |
| } |
| #endregion |
| <div id="attributeGridDiv"> |
| <telerik:RadGrid runat="server" ID="grdAttributes" AutoGenerateColumns="false" |
| BorderWidth="0" Skin="Office2007" GridLines="None" > |
| <MasterTableView> |
| <Columns> |
| <telerik:GridTemplateColumn UniqueName="chkbxSelect"> |
| <ItemTemplate> |
| <asp:CheckBox runat="server" ID="chkbxAttributeSelect" AutoPostBack="true" OnCheckedChanged="chkbxAttributeSelect_CheckedChanged" /> |
| </ItemTemplate> |
| </telerik:GridTemplateColumn> |
| <telerik:GridBoundColumn UniqueName="Name" DataField="string_Text" HeaderText="Name" DataType="System.String" /> |
| </Columns> |
| </MasterTableView> |
| </telerik:RadGrid> |
| </div> |
| <script type="text/javascript"> |
| function EndGetData2(arg) |
| { |
| document.getElementById("attributeGridDiv").innerHTML = arg; |
| } |
| setTimeout("<asp:literal runat='server' id='ltCallbackAttributeGrid' />", 3000); |
| </script> |
For Each item As GridDataItem In RGResults.Items
item.Item(
"ExpandColumn").Visible = False
item.Item(
"ExpandColumn").Width = 0
Next
For Each headerItem As GridGroupHeaderItem In RGResults.MasterTableView.GetItems(GridItemType.GroupHeader)
CType(headerItem.Controls(0).Controls(0), Button).Visible = False
Next
If isEdit AndAlso TypeOf RGResults.Columns(0) Is GridExpandColumn Then
RGResults.Columns(0).Display =
False
End If
Can this be fixed without creating a custom templatecolumn for the expand functionality..
Thanks!
I have reoccurring issues with the appearence of RadGrids in all my screens.
One common issue that occurs especially when there are a lot of columns and space is at a premium. You can view the screenshots of it here: http://www.flickr.com/photos/32500879@N07/3037010645/
Initially when the grid is rendered along with the rest of the screen during the startup, there wouldn't be any issues. Everything is where they are supposed to be. But once the grid is placed into its edit mode, the column headers are mutiated: the text alignments are lost, and appear confused between choosing wrapping the text or not, creating mirrored text and doubling the height of the header to compensate the garbled text within. Returning the grid back to its display mode doesn't fix the headers. The only known fix is to move the mouse cursor over the affected columns and they would return to their actual state.
The following is the ASP code used for the grid:
| <radG:RadGrid id="Grid" runat="server" AutoGenerateColumns="False" EnableAJAX="True" EnableAJAXLoadingTemplate="True" |
| Skin="Outlook2007" Width="100%" LoadingTemplateTransparency="25"> |
| <ClientSettings> |
| <Resizing AllowColumnResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True"/> |
| <Scrolling AllowScroll="True"/> |
| </ClientSettings> |
| <MasterTableView EditMode="InPlace" CommandItemDisplay="Bottom" DataKeyNames="SEQ,PON"> |
| <Columns> |
| <radG:GridBoundColumn UniqueName="SEQ" DataField="SEQ" DataType="System.Int32" ReadOnly="True" HeaderText="No." HeaderStyle-Width="10px"/> |
| <radG:GridTemplateColumn UniqueName="BRN" DataField="BRN" DataType="System.String" HeaderText="Branch" HeaderStyle-Width="6%"> |
| <ItemTemplate> |
| <table><asp:Label ID="lblBRN" runat="server" Text='<%#Bind("BRN")%>' Width="100%" Height="100%"/></table> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <radCB:RadComboBox ID="BRN" runat="server" EnableLoadOnDemand="True" ExternalCallBackPage="..\..\RadGrdDDLStreamer.aspx" ItemRequestTimeout="500" |
| Text='<%#Bind("BRN")%>' MaxLength="5" |
| Skin="WindowsGray" Width="100%" DropDownWidth="300px"> |
| <HeaderTemplate> |
| <table style="table-layout:fixed;"> |
| <tr> |
| <td style="width:20%; font: Tahoma; font-weight: bold; font-size: 9pt; text-align:center;">Code</td> |
| <td style="width:80%; font: Tahoma; font-weight: bold; font-size: 9pt;">Branch Name</td> |
| </tr> |
| </table> |
| </HeaderTemplate> |
| </radCB:RadComboBox> |
| </EditItemTemplate> |
| </radG:GridTemplateColumn> |
| <radG:GridBoundColumn UniqueName="PON" DataField="PON" ReadOnly="True" MaxLength="10" HeaderText="PO No." HeaderStyle-Width="4%"/> |
| <radG:GridTemplateColumn UniqueName="POG" DataField="POG" DataType="System.String" HeaderText="PO Group" ItemStyle-HorizontalAlign="Left"> |
| <ItemTemplate> |
| <table><asp:Label ID="lblPOG" runat="server" Text='<%#Bind("POG")%>' Width="100%" Height="100%"/></table> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <radCB:RadComboBox ID="POG" runat="server" EnableLoadOnDemand="True" ExternalCallBackPage="..\..\RadGrdDDLStreamer.aspx" ItemRequestTimeout="500" |
| Text='<%#Bind("POG")%>' MaxLength="10" |
| Skin="WindowsGray" Width="100%" DropDownWidth="150px"> |
| <HeaderTemplate> |
| <table style="table-layout:fixed;"> |
| <tr> |
| <td style="width:100%; font: Tahoma; font-weight: bold; font-size: 9pt;">P.O Group</td> |
| </tr> |
| </table> |
| </HeaderTemplate> |
| </radCB:RadComboBox> |
| </EditItemTemplate> |
| </radG:GridTemplateColumn> |
| <radG:GridBoundColumn UniqueName="IDS" DataField="IDS" MaxLength="100" HeaderText="Description" HeaderStyle-Width="25%" ItemStyle-HorizontalAlign="Left"/> |
| <radG:GridBoundColumn UniqueName="QTY" DataField="QTY" DataType="System.Int32" MaxLength="7" HeaderText="Qty" HeaderStyle-Width="4%" ItemStyle-HorizontalAlign="Right"/> |
| <radG:GridBoundColumn UniqueName="UPC" DataField="UPC" DataType="System.Decimal" DataFormatString="{0:#,##0.00}" MaxLength="20" HeaderText="Unit Price" HeaderStyle-Width="5%" ItemStyle-HorizontalAlign="Right"/> |
| <radG:GridTemplateColumn UniqueName="CUR" DataField="CUR" DataType="System.String" HeaderText="Currency" HeaderStyle-Width="4%"> |
| <ItemTemplate> |
| <table><asp:Label ID="CUR" runat="server" Text='<%#Bind("CUR")%>' Width="100%" Height="100%"/></table> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <radCB:RadComboBox ID="ddlSSFXRT" runat="server" EnableLoadOnDemand="True" ExternalCallBackPage="..\..\RadGrdDDLStreamer.aspx" ItemRequestTimeout="500" |
| Text='<%#Bind("CUR")%>' MaxLength="4" |
| Skin="WindowsGray" Width="100%" DropDownWidth="300px"> |
| <HeaderTemplate> |
| <table style="table-layout:fixed;"> |
| <tr> |
| <td style="width:15%; font: Tahoma; font-weight: bold; font-size: 9pt; text-align:center;">Code</td> |
| <td style="width:85%; font: Tahoma; font-weight: bold; font-size: 9pt;">Currency</td> |
| </tr> |
| </table> |
| </HeaderTemplate> |
| </radCB:RadComboBox> |
| </EditItemTemplate> |
| </radG:GridTemplateColumn> |
| <radG:GridBoundColumn UniqueName="AMT" DataField="AMT" DataType="System.Decimal" DataFormatString="{0:#,##0.00}" ReadOnly="true" HeaderText="Amount" HeaderStyle-Width="5%" ItemStyle-HorizontalAlign="Right"/> |
| <radG:GridTemplateColumn UniqueName="CBR" DataField="CBR" DataType="System.String" HeaderText="Charge To" HeaderStyle-Width="6%"> |
| <ItemTemplate> |
| <table><asp:Label ID="lblCBR" runat="server" Text='<%#Bind("CBR")%>' Width="100%" Height="100%"/></table> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <radCB:RadComboBox ID="ddlSSDATA2" runat="server" EnableLoadOnDemand="True" ExternalCallBackPage="..\..\RadGrdDDLStreamer.aspx" ItemRequestTimeout="500" |
| Text='<%#Bind("CBR")%>' MaxLength="5" |
| Skin="WindowsGray" Width="100%" DropDownWidth="300px"> |
| <HeaderTemplate> |
| <table style="table-layout:fixed;"> |
| <tr> |
| <td style="width:20%; font: Tahoma; font-weight: bold; font-size: 9pt; text-align:center;">Branch </td> |
| <td style="width:80%; font: Tahoma; font-weight: bold; font-size: 9pt;">Name</td> |
| </tr> |
| </table> |
| </HeaderTemplate> |
| </radCB:RadComboBox> |
| </EditItemTemplate> |
| </radG:GridTemplateColumn> |
| <radG:GridTemplateColumn UniqueName="EPT" DataField="EPT" DataType="System.String" HeaderText="Dept" HeaderStyle-Width="6%"> |
| <ItemTemplate> |
| <table><asp:Label ID="lblEPT" runat="server" Text='<%#Bind("EPT")%>' Width="100%" Height="100%"/></table> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <radCB:RadComboBox ID="ddlGLPAR12" runat="server" EnableLoadOnDemand="True" ExternalCallBackPage="..\..\RadGrdDDLStreamer.aspx" ItemRequestTimeout="500" |
| Text='<%#Bind("EPT")%>' MaxLength="5" |
| Skin="WindowsGray" Width="100%" DropDownWidth="300px"> |
| <HeaderTemplate> |
| <table style="table-layout:fixed;"> |
| <tr> |
| <td style="width:20%; font: Tahoma; font-weight: bold; font-size: 9pt; text-align:center;">Code</td> |
| <td style="width:80%; font: Tahoma; font-weight: bold; font-size: 9pt;">Department</td> |
| </tr> |
| </table> |
| </HeaderTemplate> |
| </radCB:RadComboBox> |
| </EditItemTemplate> |
| </radG:GridTemplateColumn> |
| <radG:GridTemplateColumn UniqueName="IVTEAM" DataField="IVTEAM" DataType="System.String" HeaderText="Team" HeaderStyle-Width="6%"> |
| <ItemTemplate> |
| <table><asp:Label ID="lblIVTEAM" runat="server" Text='<%#Bind("IVTEAM")%>' Width="100%" Height="100%"/></table> |
| </ItemTemplate> |
| <EditItemTemplate> |
| <radCB:RadComboBox ID="ddlGLPAR13" runat="server" EnableLoadOnDemand="True" ExternalCallBackPage="..\..\RadGrdDDLStreamer.aspx" ItemRequestTimeout="500" |
| Text='<%#Bind("IVTEAM")%>' MaxLength="5" |
| Skin="WindowsGray" Width="100%" DropDownWidth="300px"> |
| <HeaderTemplate> |
| <table style="table-layout:fixed;"> |
| <tr> |
| <td style="width:20%; font: Tahoma; font-weight: bold; font-size: 9pt; text-align:center;">Code</td> |
| <td style="width:80%; font: Tahoma; font-weight: bold; font-size: 9pt;">Team</td> |
| </tr> |
| </table> |
| </HeaderTemplate> |
| </radCB:RadComboBox> |
| </EditItemTemplate> |
| </radG:GridTemplateColumn> |
| <radG:GridDropDownColumn UniqueName="FXT" DataField="FXT" ListValueField="Code" ListTextField="Description" HeaderText="Fixed Asset" HeaderStyle-Width="37px"/> |
| <radG:GridDropDownColumn UniqueName="TAX" DataField="TAX" ListValueField="Code" ListTextField="Description" HeaderText="Tax" HeaderStyle-Width="37px"/> |
| <radG:GridEditCommandColumn UniqueName="cmdEdit" UpdateText="OK" InsertText="OK" HeaderStyle-Width="25px"/> |
| <radG:GridButtonColumn UniqueName="cmdDelete" Text="Delete" CommandName="Delete" ConfirmText="Do you wish to delete entry?" HeaderStyle-Width="36px"/> |
| </Columns> |
| <CommandItemTemplate> |
| <asp:Button ID="btnPrev" runat="server" CommandName="PrevPage" CssClass="linkBtn" Text="Prev"/> |
| <asp:Button ID="btnNext" runat="server" CommandName="NextPage" CssClass="linkBtn" Text="Next"/> |
| </CommandItemTemplate> |
| </MasterTableView> |
| </radG:RadGrid> |
Another that occurs is when I execute a grid command that doesn't call the grid to rebind or the page to reload. The screenshots of this issue is here : http://www.flickr.com/photos/32500879@N07/3037010649/
The previous fix, of moving the mouse cursor over the headers, would still work only for the header but the remaining of the grid still remains mutilated and not configured according to the "Outlook2007" skin's CSS file. The following is the ASP code used for the Grid:
| <radG:RadGrid id="Grid" runat="server" AutoGenerateColumns="False" EnableAJAX="True" EnableAJAXLoadingTemplate="True" |
| Skin="Outlook2007" Width="100%" LoadingTemplateTransparency="25"> |
| <ClientSettings> |
| <Resizing AllowColumnResize="True" EnableRealTimeResize="True" ResizeGridOnColumnResize="True"/> |
| <Scrolling AllowScroll="True"/> |
| </ClientSettings> |
| <MasterTableView CommandItemDisplay="Bottom"> |
| <Columns> |
| <radG:GridButtonColumn UniqueName="Add" Text="Add" CommandName="Add" HeaderStyle-Width="3%"/> |
| <radG:GridBoundColumn UniqueName="BRN" DataField="BRN" ReadOnly="True" HeaderText="Branch" HeaderStyle-Width="5%"/> |
| <radG:GridBoundColumn UniqueName="COST" DataField="COST" ReadOnly="True" HeaderText="Cost Ctr." HeaderStyle-Width="5%"/> |
| <radG:GridBoundColumn UniqueName="NUMB" DataField="NUMB" ReadOnly="True" HeaderText="Invoice No." HeaderStyle-Width="5%"/> |
| <radG:GridTemplateColumn UniqueName="DAT8" DataField="DAT8" HeaderText="Invoice Date" HeaderStyle-Width="5%"> |
| <ItemTemplate> |
| <table><asp:Label ID="DAT8" runat="server" Width="50px" Text='<%# Left(Eval("DAT8"),2) & "/" & Mid(Eval("DAT8"),3,2) & "/" & Mid(Eval("DAT8"),5) %>'/></table> |
| </ItemTemplate> |
| </radG:GridTemplateColumn> |
| <radG:GridBoundColumn UniqueName="CURR" DataField="CURR" ReadOnly="True" HeaderText="Currency" HeaderStyle-Width="5%"/> |
| <radG:GridBoundColumn UniqueName="IAMT" DataField="IAMT" ReadOnly="True" HeaderText="Invoice Amt." ItemStyle-HorizontalAlign="Right" DataType="System.Decimal" DataFormatString="{0:#,##0.00}" HeaderStyle-Width="10%"/> |
| <radG:GridBoundColumn UniqueName="OAMT" DataField="OAMT" ReadOnly="True" HeaderText="Outstanding Amt." ItemStyle-HorizontalAlign="Right" DataType="System.Decimal" DataFormatString="{0:#,##0.00}" HeaderStyle-Width="10%"/> |
| <radG:GridBoundColumn UniqueName="CRCD" DataField="CRCD" ReadOnly="True" HeaderText="Creditor" HeaderStyle-Width="5%"/> |
| <radG:GridBoundColumn UniqueName="CRNM" DataField="CRNM" ReadOnly="True" HeaderText="Creditor Name" HeaderStyle-Width="5%"/> |
| </Columns> |
| <CommandItemTemplate> |
| <asp:Button ID="btnPrev" runat="server" CommandName="PrevPage" CssClass="linkBtn" Text="Prev"/> |
| <asp:Button ID="btnNext" runat="server" CommandName="NextPage" CssClass="linkBtn" Text="Next"/> |
| </CommandItemTemplate> |
| </MasterTableView> |
| </radG:RadGrid> |
The following is the VB code for the "Add" command:
| Private Sub Grid_ItemCommand(ByVal source As Object, ByVal e As Telerik.WebControls.GridCommandEventArgs) Handles Grid.ItemCommand |
| Select Case e.CommandName |
| Case "Add" |
| If Not CommunicateWithTheHost Then 'Returns False if an error occurs with the host. |
| Grid.ResponseScripts.Add(strErrMessages) 'Displays an error message box to inidicate the "Add" function has failed. |
| e.Canceled = True |
| Else |
| Grid.ResponseScripts.Add( "alert('Added');") 'Displays a message box to indicate the "Add" function has been executed successfully. |
| End If |
| End Select |
| End Sub |
I've tried callng Grid.Rebind() after the command's execution but to no avail. The only fix I know is to call the function that is used to retrieve the grid's data and re-render the entire screen.