Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
183 views
Hello all!

I am using a RadGrid with a custom User Control as both the insert and edit form.  Within the User Control, I've defined two linkbuttons (for insert/update and for cancel) as follows:

            <asp:LinkButton ID="lkbUpdate" ValidationGroup="LocDetail"  
                Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' 
                runat="server" OnClientClick="Insert_Click();" 
                CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'
            </asp:LinkButton>&nbsp; 
            <asp:LinkButton ID="lkbCancel" Text="Cancel" runat="server" CausesValidation="False" 
                CommandName="Cancel"
            </asp:LinkButton> 
 

The actual insert (or update) logic is performed in the grid's OnInsertCommand and OnUpdateCommand handlers.  In this particular scenario, when the user performs the insert action, a number of things are going on behind the scenes (including some calculations that take a couple of seconds to complete).  During this time, the User Control form stays visible to the user.  I've added a Javascript function to the click event on the linkbutton in which I am displaying an hourglass cursor while the progress completes.

The problem I'm experiencing is that the users are impatient, and are ignoring the wait cursor and repeatedly clicking on the Insert/Update link button while the popup is visible. This is resulting in multiple, identical rows being added to the grid.  Indeed, you can see this behavior in the Telerik example of a User Control edit form at this page here - enter new data in the edit form and click on the Insert button repeatedly.  The row will be entered multiple times.

I haven't found a way to effectively disable the link button upon the click event without breaking other RadGrid behavior.  For example, within the Javascript click() handler, I've tried both disabling the button as well as clearing the href attribute; both actions prevent the RadGrid from successfully closing the popup once the insert is done.

Has anyone encountered this issue and, if so, have a workaround?


Sandra Walters
Top achievements
Rank 1
 answered on 04 May 2010
2 answers
162 views

Hi,

i have a  radgrid with nestedview, the radgrid datasource it's a webservice method that return a class that contain a list

i set the databoundcolumn datafield with object in class and the field in the nestedview with the object in the list,

column receive value nested not

Sorry for my english

post the code:

WEBSERVICE

PricesList head = new PricesList();  
                    head.ValidityDate = item.lisdata;  
                    head.Company = item.lissoc;  
                    head.ProductID = item.listart;  
                    head.ProductDescription = GetProductDescription(item.listart);  
                    head.ProductDraw = GetProductDraw(item.listart);  
                    head.CustomerID = item.listcli;  
                    head.ListType = item.listip;  
                    head.Details = new List<PricesListDetail>();  
 
                    IQueryable<LISTINO_DET> details = from det in context.LISTINO_DET  
                                                      where det.lisdata == item.lisdata && det.lissoc == item.lissoc && det.listart == item.listart && det.listcli == item.listcli && det.listip == item.listip  
                                                      orderby det.listriga  
                                                      select det;  
 
                    foreach (LISTINO_DET item_det in details)  
                    {  
                        PricesListDetail detail = new PricesListDetail();  
                        detail.Row = item_det.listriga;  
                        detail.Price = item_det.lispre;  
                        detail.ChangedPrice = item_det.lisfed;  
                        detail.Discount1 = item_det.liscon1;  
                        detail.Discount2 = item_det.liscon2;  
                        detail.Discount3 = item_det.liscon3;  
                        head.Details.Add(detail);  
                    }  
 
                    retValue.Add(head); 

ASPX

<telerik:RadGrid ID="rgPriceList" runat="server" AutoGenerateColumns="False"  
        AllowSorting="True"  GridLines="None" ShowGroupPanel="True"    
        AllowPaging="true" PageSize="10"   
        ondatabound="rgPriceList_DataBound" Skin="Hay"   
        onpageindexchanged="rgPriceList_PageIndexChanged"   
        onpagesizechanged="rgPriceList_PageSizeChanged">  
        <MasterTableView AllowMultiColumnSorting="True"  
            GroupLoadMode="Server">  
            <Columns>  
                <telerik:GridBoundColumn DataField="ProductID" HeaderText="Codice" UniqueName="colCodice">  
                </telerik:GridBoundColumn>  
                <telerik:GridBoundColumn DataField="ProductDescription" HeaderText="Articolo" UniqueName="colArticolo" >  
                </telerik:GridBoundColumn>  
                <telerik:GridBoundColumn DataField="ProductDraw" HeaderText="Disegno" UniqueName="colDisegno">  
                </telerik:GridBoundColumn>  
            </Columns>  
            <NestedViewSettings>  
                <ParentTableRelation>  
                    <telerik:GridRelationFields />  
                </ParentTableRelation>  
            </NestedViewSettings>  
            <NestedViewTemplate>  
                <asp:Panel ID="NestedViewPanel" runat="server" CssClass="viewWrap" >  
                    <div class="contactWrap">  
                        <fieldset style="padding: 10px;">  
                            <legend style="padding: 5px;"><b>Dettagli listino:&nbsp; &nbsp;<%#Eval("Details.priceField")%></b></legend>  
                            <table>  
                                <tbody>  
                                    <tr>  
                                        <td>  
                                            <table>  
                                                <tbody>  
                                                    <tr>  
                                                        <td>  
                                                            Prezzo:  
                                                        </td>  
                                                        <td>  
                                                            <asp:Label ID="lblPrice" Text='<%#Eval("Price")%>' runat="server"></asp:Label>  
                                                        </td>  
                                                    </tr>  
                                                    <tr>  
                                                        <td>  
                                                            Prezzo rivisto:  
                                                        </td>  
                                                        <td>  
                                                            <asp:Label ID="Label1" Text='<%#Eval("ChangedPrice") %>' runat="server"></asp:Label>  
                                                        </td>  
                                                    </tr>  
                                                    <tr>  
                                                        <td>  
                                                            Sconto:  
                                                        </td>  
                                                        <td>  
                                                            <asp:Label ID="Label4" Text='<%#Eval("Discount1") %>' runat="server"></asp:Label>  
                                                        </td>  
                                                    </tr>  
                                            </table>  
                                        </td>  
                                        <td>  
                                        </td>  
                                    </tr>  
                                </tbody>  
                            </table>  
                        </fieldset>  
                    </div>  
                </asp:Panel>  
            </NestedViewTemplate>  
            </MasterTableView>  
            </telerik:RadGrid> 
CS

           it.ufp.ws.Vulpes_WS ws = new it.ufp.ws.ulpes_WS();  

            rgPriceList.DataSource = ws.GetCustomerPrices(int.Parse(Session["customer_id"].ToString())); 


Matteo Beretta
Top achievements
Rank 1
 answered on 04 May 2010
2 answers
125 views
Is it possible to use a UserControl I have set up as a editor as a detail viewer as well?  I know I can accomplish this same thing using a NestedViewTemplate but it seems like it would make more sense to simply add a third mode to my editor which already does Insert and Update.
Andrew
Top achievements
Rank 1
 answered on 04 May 2010
2 answers
118 views
I have a button and a couple of textboxes on a form with two radgrid controls. I fill out the textboxes and click the button. The button calls javascript when clicked. In the handler I call get_masterTableView().rebind(); for each  radgrid. Only the last grid that I call rebind for actually rebinds. The grids both use different LinqDataSources. Each LinqDataSource has the Selecting event wired up which returns a linq result of columns. Why is only one radgrid rebinding?

Each radgrid looks similar to this one. The only difference is the ID, DataSourceID, and name of the OnGridCreated handler.

                <telerik:RadAjaxPanel ID="RadAjaxPanel2" runat="server" Height="100%" Width="100%" LoadingPanelID="RadAjaxLoadingPanel1">
                    <telerik:RadGrid ID="RadGridEnhanced" runat="server" AllowPaging="True"
                            Skin="Office2007" GridLines="None"
                            AutoGenerateColumns="False"
                            AllowAutomaticDeletes="True" ShowFooter="True"
                        DataSourceID="LinqDataSourceEnhancedAdvertising" >
                        <ClientSettings>
                            <selecting allowrowselect="True" />
                            <ClientEvents OnGridCreated="GetGridObjectEnhanced"></ClientEvents>
                        </ClientSettings>
                        <mastertableview datakeynames="ID" datasourceid="LinqDataSourceEnhancedAdvertising">
                            <Columns>
                                <telerik:GridBoundColumn DataField="PromotionStartDate"
                                    DataFormatString="{0:d}" DataType="System.DateTime" FooterText="Total"
                                    HeaderText="Promotion Start Date" SortExpression="PromotionStartDate"
                                    UniqueName="PromotionStartDate">
                                    <HeaderStyle Width="100px" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="PromotionEndDate" DataFormatString="{0:d}"
                                    DataType="System.DateTime" HeaderText="Promotion End Date"
                                    SortExpression="PromotionEndDate" UniqueName="PromotionEndDate">
                                    <HeaderStyle Width="100px" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn Aggregate="Sum" DataField="DiscountValue"
                                    DataFormatString="{0:C}" DataType="System.Double" DefaultInsertValue=""
                                    FooterAggregateFormatString="{0:C}" HeaderText="Discount Value"
                                    SortExpression="DiscountValue" UniqueName="DiscountValue">
                                    <HeaderStyle Width="100px" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="CityRegion" DataType="System.String"
                                    HeaderText="City/Region" SortExpression="CityRegion" UniqueName="CityRegion">
                                    <HeaderStyle Width="100px" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="IndustryType" DataType="System.String"
                                    HeaderText="Industry Type" SortExpression="IndustryType"
                                    UniqueName="IndustryType">
                                    <HeaderStyle Width="100px" />
                                </telerik:GridBoundColumn>
                                <telerik:GridBoundColumn DataField="ID" DataType="System.Int32" Display="False"
                                    HeaderText="ID" ReadOnly="True" SortExpression="ID" UniqueName="ID">
                                </telerik:GridBoundColumn>
                            </Columns>
                        </mastertableview>
                    </telerik:RadGrid>
                </telerik:RadAjaxPanel>

    <asp:LinqDataSource ID="LinqDataSourceEnhancedAdvertising" runat="server"
        AutoPage="False" ContextTypeName="CharityCheck.CharityCheckEntities"
        onselecting="LinqDataSourceEnhancedAdvertising_Selecting"
        TableName="EnhancedBusinessAdvertisingsSet">
    </asp:LinqDataSource>

Tsvetoslav
Telerik team
 answered on 04 May 2010
3 answers
167 views
Hi,

Does anybody know how I might determine whether the "select all" check box has been pressed? I've worked out that by checking the "select all" checkbox the RowSelected event is fired for all rows in the table but I have no way of telling if the "select all" check box has been checked.

Thanks in advance.

Antony
Antony
Top achievements
Rank 1
 answered on 04 May 2010
0 answers
102 views

In my project I am using telerik RadComboBox version 2.6.0, RadAjax.Net2.dll version 1.6.0 and ajaxcontroltoolkit version 3.0.20820.31333 and .net 3.5

  1. on my page I have a asp.net drop down control inside a ajax update panel,and the second update panel which contain the AsyncPostBackTrigger attached with the drop down to update the content of the second update panel.
  2. RadComboBox inside the RadAjaxPanel.
  3. when the selectedindex changed of drop down is fired I got the error “sys.WebForms.PageReuestManagerServerErrorException: Ambiguous match found”.

 

Can you please let me know what is the issue.

ajeet singh
Top achievements
Rank 1
 asked on 04 May 2010
2 answers
93 views
I'm building a calendar application, using a custom appointment form based on one of the examples floating around here. Anyway sometimes I need the Appointment to be read only. I've got that part 90% there by using enabled=false for everything, but when I do that for the RadDatePicker on mouseover an error is thrown in MicrosoftAjax.js. I don't have any mouseover events, so I'm at a loss here.

Any ideas what could be throwing the error?
Paul Nascimento
Top achievements
Rank 1
 answered on 04 May 2010
6 answers
756 views
Good afternoon,
I am entering search criteria and click seach button,while radgrid is loading I want to show user page is working properly and data is loading for that purpose I would like to create progress bar indicator.Any idea how to do it?
Also I have the other radgrid,when first already loaded and user click any row the second radgrid should be loading and I also need a progress bar indicator for that purpose as well.

Thanks so much for your help.
Vasya Ivanov
Top achievements
Rank 1
 answered on 04 May 2010
4 answers
127 views
Good morning,
I used the following code for progress bar indicator:

 

 <telerik:RadScriptManager ID="ScriptManager1" runat="server" />
<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server" >

 

 

<AjaxSettings>

 

<telerik:AjaxSetting AjaxControlID="JobReportGrid">

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="JobReportGrid" LoadingPanelID="RadAjaxLoadingPanel1" />

</UpdatedControls>

</telerik:AjaxSetting>

<telerik:AjaxSetting AjaxControlID="JobDetailGrid">

<UpdatedControls>

<telerik:AjaxUpdatedControl ControlID="JobDetailGrid" LoadingPanelID="RadAjaxLoadingPanel1" />

</UpdatedControls>

</telerik:AjaxSetting>

</AjaxSettings>

</telerik:RadAjaxManager>

 

 

 

<telerik:RadAjaxLoadingPanel ID="RadAjaxLoadingPanel1" EnableAjaxSkinRendering="true" runat="server">

 

 

</telerik:RadAjaxLoadingPanel>

I have two radgrid:JobReportGrid and JobDetailGrid.
When I entered search criteria progress bar does not work but when I changed size of the page progress bar is working.
Also when I click on the row in my JobReportGrid progress bar is working but data in JobDetailgrid not display and I know for sure that there is a data.
when I comment  out above coding everything working perfectly but I need progress bar indicator.

Thanks so much for your help.

 

Vasya Ivanov
Top achievements
Rank 1
 answered on 04 May 2010
8 answers
273 views
I want to use the LoD functionality of RadToolTipManager with a number of buttons defined in a RadToolBar.

Everything I've read suggests that I need to update the TargetControls collecton with the ID of the button. Now, I can't /set/ the ID of a ToolBarButton, but I can get at the ClientID of one, so, I'm doing this ...
RadToolBarButton btn = RadToolBar1.FindItemByValue("MoveFiles"as RadToolBarButton; 
RadToolTipManager1.TargetControls.Add(btn.ClientID, true); 

I have wired up the OnAjaxRequest event of the ToolTipManager but it never fires.

I can't figure out why.

Can anyone help?

--
Stuart
Svetlina Anati
Telerik team
 answered on 04 May 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?