Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
154 views

I am putting into my heriarchial grids in-line editing but am running into a problem of how to get at the editing of the lower grids.  i have the 1st grid working but how can I get at the sub grid to edit them inline.  How can I have a unique update name, insert or delete fro each level of the grid.  How can I differenitate between these 2 update commands for differetn grids.  the 1st one is for the top level grid and the second one is for the 1st sub-level. 

Protected Sub myRadGrid_ItemCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles myRadGrid.ItemCommand
      'All the Inline Update Commands
      If (e.CommandName = RadGrid.UpdateCommandName) Then
          Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
          Dim Id As Integer = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("intCategoryId")
          Dim Cat As TextBox = CType(editedItem.FindControl("txtCategory"), TextBox)
          Dim NSN As TextBox = CType(editedItem.FindControl("txtNSN"), TextBox)
          Dim LIN As TextBox = CType(editedItem.FindControl("txtLin"), TextBox)
          sql = "Update Drat_Category set strCategory = '" & sanitizeString(Cat.Text.ToUpper) & "', strNSN = '" & sanitizeString(NSN.Text.ToUpper) & "', strLIN = '" & sanitizeString(LIN.Text.ToUpper) & "' " _
              & "where intCategoryId = " & Id
          insertUpdateDelete(sql)
          myRadGrid.Rebind()
      End If
      If (e.CommandName = RadGrid.UpdateCommandName) Then
          Dim editedItem As GridEditableItem = CType(e.Item, GridEditableItem)
          Dim Id As Integer = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("intManufacturerId")
          Dim Man As TextBox = CType(editedItem.FindControl("txtManufacturer"), TextBox)
          sql = "Update Drat_Manufacturer set strmanufacturer = '" & sanitizeString(Man.Text.ToUpper) & "' where intManufacturerId = " & Id
          insertUpdateDelete(sql)
          myRadGrid.Rebind()
Kevin
Top achievements
Rank 1
 answered on 28 Mar 2012
3 answers
1.2K+ views
I am trying to add a simple add record button to the Header of a RadGrid, but I just can't seem to do it through Editor.  The Edit/Delete functions work fine. Using the latest version of RadControls(downloaded demo yesterday). 
<%@ Control language="vb" Inherits="DotNetNuke.Modules.CSAEditor.View" AutoEventWireup="false" Explicit="True" Codebehind="View.ascx.vb" %>
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
 
<telerik:RadGrid ID="rgcsaEditor" runat="server" AllowAutomaticDeletes="True"
    AllowAutomaticInserts="True" AllowAutomaticUpdates="True"
    AllowMultiRowEdit="True" AutoGenerateColumns="False"
    AutoGenerateDeleteColumn="True" AutoGenerateEditColumn="True" CellSpacing="0"
    DataSourceID="CSAlDataSource" GridLines="None" Skin="Telerik">
<ClientSettings>
<Selecting CellSelectionMode="None"></Selecting>
    <Scrolling AllowScroll="True" UseStaticHeaders="True" />
</ClientSettings>
 
<MasterTableView datakeynames="csaId" datasourceid="CSAlDataSource">
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
<HeaderStyle Width="20px"></HeaderStyle>
</RowIndicatorColumn>
 
<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
<HeaderStyle Width="20px"></HeaderStyle>
</ExpandCollapseColumn>
 
    <Columns>
        <telerik:GridBoundColumn DataField="csaId" DataType="System.Int32"
            Display="False" FilterControlAltText="Filter csaId column" HeaderText="csaId"
            ReadOnly="True" SortExpression="csaId" UniqueName="csaId">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="csaName"
            FilterControlAltText="Filter csaName column" HeaderText="csaName"
            SortExpression="csaName" UniqueName="csaName">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="csaWebAddr"
            FilterControlAltText="Filter csaWebAddr column" HeaderText="csaWebAddr"
            SortExpression="csaWebAddr" UniqueName="csaWebAddr">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="csaNotes"
            FilterControlAltText="Filter csaNotes column" HeaderText="csaNotes"
            SortExpression="csaNotes" UniqueName="csaNotes">
        </telerik:GridBoundColumn>
        <telerik:GridCheckBoxColumn DataField="csaActive" DataType="System.Boolean"
            FilterControlAltText="Filter csaActive column" HeaderText="csaActive"
            SortExpression="csaActive" UniqueName="csaActive">
        </telerik:GridCheckBoxColumn>
        <telerik:GridCheckBoxColumn DataField="csaBuyingClub" DataType="System.Boolean"
            FilterControlAltText="Filter csaBuyingClub column" HeaderText="csaBuyingClub"
            SortExpression="csaBuyingClub" UniqueName="csaBuyingClub">
        </telerik:GridCheckBoxColumn>
    </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
 
</MasterTableView>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
</telerik:RadGrid>
<asp:SqlDataSource ID="CSAlDataSource" runat="server"
    ConnectionString="<%$ ConnectionStrings:CsalwfConnectionString %>"
    DeleteCommand="usp_DeleteCSA_INFO" DeleteCommandType="StoredProcedure"
    InsertCommand="usp_InsertCSA_INFO" InsertCommandType="StoredProcedure"
    SelectCommand="usp_SelectCSA_INFOsAll" SelectCommandType="StoredProcedure"
    UpdateCommand="usp_UpdateCSA_INFO" UpdateCommandType="StoredProcedure">
    <DeleteParameters>
        <asp:Parameter Name="csaId" Type="Int32" />
    </DeleteParameters>
    <InsertParameters>
        <asp:Parameter Name="csaName" Type="String" />
        <asp:Parameter Name="csaWebAddr" Type="String" />
        <asp:Parameter Name="csaNotes" Type="String" />
        <asp:Parameter Name="csaActive" Type="Boolean" />
        <asp:Parameter Name="csaBuyingClub" Type="Boolean" />
        <asp:Parameter Direction="InputOutput" Name="csaId" Type="Int32" />
    </InsertParameters>
    <UpdateParameters>
        <asp:Parameter Name="csaId" Type="Int32" />
        <asp:Parameter Name="csaName" Type="String" />
        <asp:Parameter Name="csaWebAddr" Type="String" />
        <asp:Parameter Name="csaNotes" Type="String" />
        <asp:Parameter Name="csaActive" Type="Boolean" />
        <asp:Parameter Name="csaBuyingClub" Type="Boolean" />
    </UpdateParameters>
</asp:SqlDataSource>
Maria Ilieva
Telerik team
 answered on 28 Mar 2012
1 answer
64 views
Hello,

we still use the version 2010.3.1317 of the ASP.NET AJAX Controls and encounter a bunch of FxCop errors (like SealMethodsThatSatisfyPrivateInterfaces or DoNotDeclareReadOnlyMutableReferenceTypes) which does not satisfy the quality department.
Are these errors all fixed in the current version?
Dobromir
Telerik team
 answered on 28 Mar 2012
1 answer
96 views
Hello there,

hey frnds while i'm setting the scrolling property in the ClientSettings of the Rad Grid then the grid is completely damaged can any one please help me out. even i've seen the Demo also but its not solved
Eyup
Telerik team
 answered on 28 Mar 2012
1 answer
61 views
Hi,
how to set size for RadSplitter using Jquery?

Thanki.
Dobromir
Telerik team
 answered on 28 Mar 2012
5 answers
116 views
I was wondering if it was possible to use our own custom modal from instead of AdvancedInsertTemplate. So when a user double clicks on the Appointment instead of showing him/her a AdvancedInsertTemplate our own Modal form will show up. When user fills out that modal form and click Insert we will simply re-bind scheduler to see new appointment. Thanks
Peter
Telerik team
 answered on 28 Mar 2012
1 answer
159 views
I have Test.aspx that contains a RadScheduler. I am binding the scheduler to a DataTable and the data table is based on a SQL Server 2008 table. The table in the SQL Server database is tblAppointments, modeled after a table in Aspnetdb.mdf; a sample database included with the Telerik ASP.NET Ajax installation (Telerik.Web.UI, v.2011.3.1305.40 Dev).
When Test.aspx first loads, it will correctly display within the sceduler all of the appointments that have been stored in tblAppointments. When I modify any of the appointments displayed by the scheduler, the scheduler is refreshed, but after the refresh, no appointments are displayed (none of the appointments are displayed by the scheduler). If I close and start a new browser instance that re-opens Test.aspx, then the appointments reappear, including the latest modification that I made to one of the appointments.
I have googled the snot out of this and have reviewed the following resources, but these have not helped me to find the cause of my problem:
I can upload my ASPX and its code for anyone who would like to review it, but you would have to find a SQL Server database that you can connect to, plus find an appointments table. This telerik control isn't going to do me any good if I can't find a solution to this problem.
Thanks,
Steven
Peter
Telerik team
 answered on 28 Mar 2012
1 answer
108 views
My apologies in advance.

I know this question has been asked millions of times. I've seen them all over the place in the forums. 

However, I'm not really sure that, all those times, the right question was actually asked. So, please, let me try for the 1000001 time:

I have this table with customer info of all kinds, which when fully expanded, takes tens of thousands of records. I would like to show this table to the users of my application using a RadGrid. Of course, I don't want to shove the full contents of this table at once to my users' throats; I would like the data to show gradually, as the users scroll in the table, in chunks of 100 by 100 (preferably).

Using many, many techniques, the RadGrid can do this just fine.

Now, I would also like to enable this cool functionality of the RadGrid that, when a user drags a column cell to the top of the grid, the grid automatically groups the data and displays it hierarchically, much like a tree view, with one, two, or many columns if needed.

So, you see, basically I would like (as the title said) Outlook-style grouping, *and at the same time*, on-demand loading of data into the grid, to make my users' life easier. 

Is this feasible, at all, with the current version of the RadGrid? What is the right combination of techniques that will let me do this thing I just described? Name them however you want, I don't care. Just, please, tell me what can I do to implement such a scenario.

Any comments will be highly appreciated!

Maria Ilieva
Telerik team
 answered on 28 Mar 2012
3 answers
223 views
Hi,

I am using Radgrid in one of my project ,i want to get editImageUrl and want to change it from code behind;
When i run the application and if i try to get the editimageurl i am getting the following error.
"Object reference not set to an instance of an object."
The html i am using is

<

 

MasterTableView DataKeyNames="Id" AutoGenerateColumns="false" CommandItemDisplay="Top">

<Columns>

<telerik:GridEditCommandColumn UniqueName="EditCommandColumn" HeaderText="Edit column" ButtonType="ImageButton"

 

EditImageUrl = "

~/Alarm.png"

 

 >

<ItemStyle Width="50px" />

</telerik:GridEditCommandColumn>

......

if i try to get "EditImageUrl " of grideditcommandcoloumn it is throughting the above error.
Note:I tried to assign GridEditCommandColoumn from codebehind same issue is coming
Code:

GridEditCommandColumn edc = new GridEditCommandColumn();

edc.ButtonType =

GridButtonColumnType.ImageButton;

edc.EditImageUrl =

"~/Alarm.png";

Response.Write(edc.EditImageUrl);


Please help me on this.
Princy
Top achievements
Rank 2
 answered on 28 Mar 2012
1 answer
126 views
Hi,

I resize my grid when the window load. It works well for every browser except Internet Explorer. The grid is always "null".

I tried what they say in this thread, but this is not working, so I guess I got something different.

Here is my code (jQuery):

$(window).load(function()
{
    Resize();
 
    $(window).resize(function()
    {
        Resize();
    });
});
 
function Resize()
 {
    var grid = $find("<%= mygrid.ClientID %>");
    if (grid != null)
    {
        grid.get_element().style.height = $("#form1").height() + "px";
        grid.repaint();
    }
 }

What am I missing?

I don't want to use pageLoad because it fire before Pictures are load, that's why I'm using $(window).load().

Thanks
Pavlina
Telerik team
 answered on 28 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?