Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
149 views
Hi, we have a .net user control that works very well as an edit form within the grid, with one exception. We have an Insert button, an Update button and finally a Cancel button, with CommandNames set to Insert, Update, and Cancel respectively. Depending on whether a primary key value exists from the database, we either hide the insert button or show it. 

If we are updating, the form performs as expected and the edit form disappears and the grid updates with the new values.

But inserts fail to make the edit form disappear. If we click cancel, the edit form disappears and we see the newly inserted value in the grid. 

We were under the assumption that setting the Command Name to Insert would be what we need, but apparently this is not the case. Does anyone have any ideas on either, a) what we are doing wrong or b) a way to force the edit form to close... from within the edit form control as that is where the post back and processing takes place. Many thanks.
Viktor Tachev
Telerik team
 answered on 21 Nov 2013
4 answers
191 views
I would like to pass a parameter to the webservice that would populate my dropdown.  It doesn't appear that this is currently possible?

Specifically I want to limit the values of one dropdown from the selection made in another dropdown.
Rumen
Telerik team
 answered on 21 Nov 2013
1 answer
123 views
hi,

In  my rad gird i am using radbutton with button type as "ToggleButton" to fill the all the text boxes based on one calculation. it is working fine for functionality. But the problem is when ever the grid is in edit mode. the table layout is fixed and looks good. but When i click the radButton the grid design is not stable though it worked fine for functionality.  
Here i attached the screen shots before the button click and after the button click. Also the desing code.

Thank You.
<telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False" OnItemDataBound="RadGrid1_ItemDataBound" OnItemCreated="RadGrid1_ItemCreated"
        AllowSorting="True" AllowMultiRowSelection="False" OnItemCommand="RadGrid1_ItemCommand" AutoGenerateEditColumn="false" OnDataBound="RadGrid1_DataBound"
        OnDetailTableDataBind="RadGrid1_DetailTableDataBind" OnNeedDataSource="RadGrid1_NeedDataSource" OnInsertCommand="RadGrid1_InsertCommand"
        OnPreRender="RadGrid1_PreRender">
 
        <MasterTableView DataKeyNames="TempAccountsId" ShowFooter="true" TableLayout="Auto" AllowMultiColumnSorting="True" EditMode="InPlace">
            <DetailTables>
                <telerik:GridTableView DataKeyNames="CleaningId" CommandItemDisplay="Top" TableLayout="Fixed" Name="Cleaning" ShowFooter="true" EditMode="InPlace" AllowAutomaticUpdates="false">
                    <Columns>
                        <telerik:GridTemplateColumn Visible="false">
                            <ItemTemplate>
                                <asp:Label ID="lblCleaningId" runat="server" Text='<%#Eval("CleaningId") %>'></asp:Label>
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridEditCommandColumn ButtonType="ImageButton" HeaderText="Edit" UniqueName="Edit" HeaderStyle-Width="70px" ItemStyle-Width="70px" HeaderStyle-HorizontalAlign="Center"
                            EditImageUrl="../Images/edit.gif" ItemStyle-HorizontalAlign="Center"  >
                        </telerik:GridEditCommandColumn>
                        <telerik:GridTemplateColumn HeaderText="Delete" UniqueName="Delete" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="45px" ItemStyle-Width="45px" ItemStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:ImageButton runat="server" ID="imgdelete" OnClientClick="return confirm('Are you sure that you want to Delete?');"
                                    ImageUrl="../Images/delete.gif" CommandName="Delete" CommandArgument="" />
                            </ItemTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Description" UniqueName="Description" ItemStyle-Wrap="true" HeaderStyle-HorizontalAlign="Center" HeaderStyle-Width="170px" ItemStyle-Width="160px">
                            <ItemTemplate>
                                <asp:Label ID="lblExplanation" runat="server" Text='<%#Eval("Description") %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <asp:TextBox ID="txtDescriptionEdit" runat="server" Text='<%#Eval("Description") %>' Width="155px"
                                    MaxLength="180"></asp:TextBox>
                            </EditItemTemplate>
                            <InsertItemTemplate>
                                <asp:TextBox ID="txtDescriptionInsert" runat="server" Width="155px"
                                    MaxLength="180" BorderWidth="1px"></asp:TextBox>
                            </InsertItemTemplate>
                            <FooterTemplate>
                                <asp:Label ID="lblSubtotalFooter" runat="server" Text="Sub Total"></asp:Label>
                            </FooterTemplate>
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn>
                            <ItemTemplate>
                                <asp:Label ID="lblNotes" runat="server" Text='<%#Eval("Notes") %>' Visible="false"></asp:Label>
                                <asp:ImageButton ID="imgNotes" runat="server" ImageUrl="~/Images/TextboxHS.png" CommandArgument='<%#Eval("CleaningId") %>'
                                    CommandName="OpenWindowView" Visible="false" />
                            </ItemTemplate>
                            <HeaderStyle Width="30px" />
                        </telerik:GridTemplateColumn>
                        <telerik:GridTemplateColumn HeaderText="Notes" UniqueName="Notes">
                            <ItemTemplate>
                                <asp:ImageButton ID="imgNotesEdit" ImageUrl="~/Images/edit.gif" runat="server"
                                    CommandName="OpenWindow" CommandArgument='<%#Eval("CleaningId") %>' />
                            </ItemTemplate>
                            <HeaderStyle Width="40px" />
                        </telerik:GridTemplateColumn>
 
                        <telerik:GridTemplateColumn HeaderStyle-Width="220px" UniqueName="Rate" HeaderText="Rate" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="210px"
                            HeaderStyle-HorizontalAlign="Center">
                            <ItemTemplate>
                                <asp:RadioButton ID="rdbtnPerSqft" runat="server" Text="PerSqft" GroupName="Rate" Enabled="false" Checked='<%# bool.Parse(Eval("IsPerSqftRate").ToString()) %>' />
                                <asp:RadioButton ID="rdbtnFlat" runat="server" Text="Flat" GroupName="Rate" Enabled="false" Checked='<%# bool.Parse(Eval("IsFlatRate").ToString()) %>' />
                                <asp:Label ID="lblPerSqFtRatedisplay" runat="server" Width="50px" Style="text-align: right;" Text='<%# string.Format("{0:n}", Convert.ToDecimal(Eval("PerSqFtRate"))) %>'></asp:Label>
                            </ItemTemplate>
                            <EditItemTemplate>
                                <telerik:RadButton ToggleType="Radio" ID="rdbtnPerSqftEdit" Width="40px" ButtonType="ToggleButton" CommandName="PerSqftRate" Text="PerSqft" runat="server" GroupName="Rate" Checked='<%# bool.Parse(Eval("IsPerSqftRate").ToString()) %>'>
                                </telerik:RadButton>
                                <telerik:RadButton ToggleType="Radio" ID="rdbtnFlatEdit" Width="20px" ButtonType="ToggleButton" CommandName="Flatrate" Text="Flat" runat="server" GroupName="Rate" Checked='<%# bool.Parse(Eval("IsFlatRate").ToString()) %>'>
                                </telerik:RadButton>
                                <asp:TextBox ID="txtRateEdit" runat="server" Width="80px" CssClass="AlgRgh" Visible="true" Text='<%# string.Format("{0:n}", Convert.ToDecimal(Eval("PerSqFtRate"))) %>'
                                    onkeypress="javascript:return Allownumbersonly(event);" BorderWidth="1px"></asp:TextBox>
                                <asp:Label ID="lblRateEdit" runat="server" Visible="false" Text='<%# string.Format("{0:n}", Convert.ToDecimal(Eval("PerSqFtRate"))) %>'></asp:Label>
                            </EditItemTemplate>
                            <InsertItemTemplate>
                                <telerik:RadButton ToggleType="Radio" ID="rdbtnPerSqftinsert" Width="40px" ButtonType="ToggleButton" CommandName="PerSqftinsert" Text="PerSqft" runat="server" GroupName="Rate">
                                </telerik:RadButton>
                                <telerik:RadButton ToggleType="Radio" ID="rdbtnFlatinsert" Width="20px" ButtonType="ToggleButton" CommandName="Flatrateinsert" Text="Flat" runat="server" GroupName="Rate">
                                </telerik:RadButton>
                                <asp:TextBox ID="txtRateinsert" runat="server" Width="80px"
                                    onkeypress="javascript:return Allownumbersonly(event);" BorderWidth="1px"></asp:TextBox>
                            </InsertItemTemplate>
                        </telerik:GridTemplateColumn>
 
                        
                    </Columns>
                </telerik:GridTableView>
            </DetailTables>
            <Columns>
                <telerik:GridTemplateColumn HeaderText="AccountId" UniqueName="TempAccountsId" Visible="false">
                    <ItemTemplate>
                        <asp:Label ID="lblTempAccountsId" runat="server" Text='<%#Eval("TempAccountsId") %>'></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn HeaderText="Account Number" UniqueName="AccountNumber" ItemStyle-Width="120px" HeaderStyle-Width="120px" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left">
                    <ItemTemplate>
                        <asp:Label ID="lblAccountNumber" runat="server" Text='<%#Eval("AccountNumber") %>'></asp:Label>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn HeaderText="Account Name" UniqueName="AccountName" ItemStyle-Width="210px" HeaderStyle-Width="220px" HeaderStyle-HorizontalAlign="left" ItemStyle-HorizontalAlign="left">
                    <ItemTemplate>
                        <asp:Label ID="lblAccountName" runat="server" Text='<%#Eval("AccountName") %>'></asp:Label>
                    </ItemTemplate>
                    <FooterTemplate>
                        <asp:Label ID="lbltotalFooter" runat="server" Text="Total:"></asp:Label>
                    </FooterTemplate>
                </telerik:GridTemplateColumn>
                
 
            </Columns>
        </MasterTableView>
        <ClientSettings AllowKeyboardNavigation="true" EnableRowHoverStyle="true">
        </ClientSettings>
    </telerik:RadGrid>
Venelin
Telerik team
 answered on 21 Nov 2013
1 answer
159 views
I am getting the error (Object Reference not set to an instance of an Object) on adding the Telerik SPradgridview webpart into my site i have already given anonymous accesss for the vti_bin\telerik.ajax.sharepoint folders,

Note :  SPradlistview webpart is working fine on adding into my site


looking for a resolution from telerik team
Marin
Telerik team
 answered on 21 Nov 2013
1 answer
88 views
When I open a new project in vs 2012 "new empty template asp" and I add radcombobox everything is fine and very little viewstate. But if I open a new project vs 2012 "new website" - No empty templat!!! and I add  radcombobox the viewstate
 very long and unusual something wrong. Why???
Nencho
Telerik team
 answered on 21 Nov 2013
5 answers
226 views
Hi,

Can you point me in the right direction on how to add a new blank row to radgrid on the client using javascript?
Here's what i have so far. Onclient button click I call a web service to insert a blank row into database,
then on success of the web service call I rebind the grid on client. Here is the code: There's also a screen shot to give you a better idea.
  function updateChanges() {
             ItemsService.AddNewItem(updateGrid());   
         }
         function updateGrid(result) {
            var masterTable = $find("<%= grdInvoiceItems.ClientID %>").get_masterTableView();
            masterTable.fireCommand("RebindGrid");
 
//             $find("<%= grdInvoiceItems.ClientID %>").get_masterTableView().rebind();
         }

Thanks,
Ron
Angel Petrov
Telerik team
 answered on 21 Nov 2013
1 answer
101 views
Hi guys,
I have a following code in my aspx page:
<telerik:RadComboBox ID="RadComboBoxStatusGrp" runat="server" Width="125px"
             Height="150px" Font-Size="Small" CssClass="txtinput" AutoPostBack="false"
             EmptyMessage="Choose a Status" ShowToggleImage="true"
              OnClientDropDownOpened="OnClientDropDownOpenedHandler">

             
      <ItemTemplate>
       <div id="div1">
       <telerik:RadTreeView runat="server" ID="RadTreeView1" OnClientNodeClicking="nodeClicking">
        <Nodes>
          <telerik:RadTreeNode runat="server" Text="All Trans" Expanded="true" >
           <Nodes>
            <telerik:RadTreeNode runat="server" Text="Approved"  >
            </telerik:RadTreeNode>
             <telerik:RadTreeNode runat="server" Text="Entered"  >
             </telerik:RadTreeNode>
                         
            </Nodes>
            </telerik:RadTreeNode>
            </Nodes>  
            <Nodes>
             <telerik:RadTreeNode runat="server" Text="Processed" ></telerik:RadTreeNode>
            </Nodes>
            <Nodes>
             <telerik:RadTreeNode runat="server" Text="All" ></telerik:RadTreeNode>
            </Nodes>  
       </telerik:RadTreeView>
       </div>
      </ItemTemplate>
      <Items>
        <telerik:RadComboBoxItem Text="" />
      </Items>
     </telerik:RadComboBox>
      <script type="text/javascript">
          var div1 = document.getElementById("div1");
          div1.onclick = StopPropagation;
            </script>
When I ran first time my application I choose node("Approved") and click on it and this node appear in the combobox, I click search button and everything is working fine but next time  I want to choose the other node("Entered") and when I click once but this node  not showing in combobox I need to click it again to get this node show in combobox.

Please help me,
Thanks
Shinu
Top achievements
Rank 2
 answered on 21 Nov 2013
1 answer
80 views
Hello,

I have multiple radgrids on a page and i'm trying to freeze left 2 columns for each.
But it works only for the first grid on the page.
Sample code is given below:
First two grids have same number of rows. Second row would have two grids similar to first row but would have less rows.
Can you please help with a sample code?
<table>
<tr>
                    <td style="width: 590px">
                        <asp:Panel ID="panelRateReport" ScrollBars="Horizontal" Width="99.8%" runat="server"
                            Height="410">
                            <telerik:RadGrid runat="server" ID="gridRate" AutoGenerateColumns="true" Height="99%"
                                Skin="Hay" GridLines="Both" OnPreRender="gridRate_PreRender" OnColumnCreated="gridRate_ColumnCreated"
                                OnItemDataBound="gridRate_ItemDataBound">
                            </telerik:RadGrid>
                        </asp:Panel>
                    </td>
                    <td style="width: 20px">
                    </td>
                    <td>
                        <asp:Panel ID="panel1" runat="server" ScrollBars="Horizontal" Width="99.8%" Height="410">
                            <telerik:RadGrid runat="server" ID="gridRateAbove10k" AutoGenerateColumns="true"
                                Height="99%" GridLines="Both" Skin="Hay" OnPreRender="gridRate_PreRender"
                                OnColumnCreated="gridRate_ColumnCreated" OnItemDataBound="gridRate_ItemDataBound">
                            </telerik:RadGrid>
                        </asp:Panel>
                    </td>
                </tr>
<tr>
....
</tr>
<table>
Princy
Top achievements
Rank 2
 answered on 21 Nov 2013
18 answers
1.9K+ views
I'm having trouble getting a required field validator attached to work with RadAsyncUpload.
I am using Peter Blum validation, but I imagine the problem is the same with basic .NET validators.

The Peter Blum RequiredTextValidator doesn't work with RadAsyncUpload.

Instead I tried a custom validator with the following client-side function:

function AsyncUploadRequiredValidation(cond) {
    var uploader = $find(cond.IDToEval);
                     
    return (uploader.getUploadedFiles().length == 0) ? 0 : 1;
}

But this code throws an exception: 'getUploadedFiles is not a function'. The $find method does find something, but none of the RadAsyncUpload's client-side functions available on the returned object.
Shinu
Top achievements
Rank 2
 answered on 21 Nov 2013
27 answers
5.9K+ views
Hello,

I am running Windows Server 2008 (IIS7) and am getting the following error:

'~/Telerik.Web.UI.WebResource.axd' is missing in web.config. RadScriptManager requires a HttpHandler registration in web.config.

I have already found information in the forum and your troubleshooting guides about moving the Telerik handler from the HttpHandler section to the system.webServer handlers area.  I have this in my web.config:

<system.webServer> 
    <handlers> 
    ...     
    <add path="Telerik.Web.UI.WebResource.axd" verb="*" type="Telerik.Web.UI.WebResource, Telerik.Web.UI, Version=2008.1.415.35, Culture=neutral, PublicKeyToken=121fae78165ba3d4" 
         name="Telerik.Web.UI.WebResource"/> 
    </handlers> 
    ... 
</system.webServer> 

However, when I try to run my page that has an RadScriptManager on it, I get the error mentioned earlier.  The handler does not appear to be loading.

Any help with this would be appreciated.

Thanks,
Stephen
Kuldeep
Top achievements
Rank 1
 answered on 21 Nov 2013
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?