Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
143 views
My grid is updated via a stored procedure, and when a user is updated, the stored procedure deletes the current one being updated and adds a new one. So every time the database is updated, I need to re draw the grid. In the C# code behind, which function call do I need to do this in, and what is the code to redraw the grid?

Thanks,
Laura
Vladimir
Top achievements
Rank 1
 answered on 04 Oct 2008
0 answers
129 views
Hi,
            I  am using drill down rad chart at the particular stage i no need to click the radchart how to do this .

Give me the solution.
Giri
Top achievements
Rank 1
 asked on 04 Oct 2008
0 answers
195 views
hi,
I am using Cascading dropdowns in .Net 2.0. I am getting the following error while running the website.

Microsoft JScript runtime error: ASP.NET Ajax client-side framework failed to load.

Please help me if any one know the resolution for the error.

Thanks,
Ravi
Ravi Kishore
Top achievements
Rank 1
 asked on 04 Oct 2008
3 answers
105 views
Hi,

 I open a radwindow (radwindow2) from a radwindow (radwindow1) in order to select a date.  If I openened the radwindow directly from a browser window I can set the value in the browser window using the following javascript code:

GetRadWindow().BrowserWindow.setValue(gup(

'TargetControlID'), value);

gup is just a function that returns the parameter value from the querstring.

THe problem is that when I use the above code from radwindow2 in order to set a value on Radwindow1, I get a javascript error.  I think this is because the object returned by GetRadWindow().BrowserWindow is not the same as if I were just one radwindow deep.

How should I change the code to set  a value  on the parent window of a radwindow when the parent that is also a radwindow?

Thanks
Jonathan

Jonathan
Top achievements
Rank 1
 answered on 03 Oct 2008
2 answers
155 views
I know you can navigate the Treeview pretty well using only the keyboard.  However, is there a way to simulate the drag & drop feature with the keyboard?  Is there a cut & paste function like you would have in a windows file system explorer?

Tom
Tom Lynch
Top achievements
Rank 1
 answered on 03 Oct 2008
1 answer
184 views
I am trying to (via javascript) find a Button inside of a RadPanelItem. I read how to do it but all the samples I read always find Telerik controls. When I tried doing it the same way for the button the button obj in javascript is null. I am able to find the colorpicker in the sample below, but not the button.

RadPanelItem

<

telerik:RadPanelBar ID="RadPanelBar1" runat="server">
  <Items>
    <telerik:RadPanelItem Text="Travelers" Value="Travelers" Expanded="true">
     <Items>
      <telerik:RadPanelItem>
       <ItemTemplate>
          <asp:Button ID="ColorPicker" OnClientClick="GetbtnTEST();" runat="server" Text="TEST"/>
         <telerik:RadColorPicker ID="sdColorPicker" runat="server"></telerik:RadColorPicker>
       </ItemTemplate>
      </telerik:RadPanelItem>
     </Items>
    </telerik:RadPanelItem>
  </Items>
</
telerik:RadPanelBar>

right now the button calls this on the onclick, but this will not be the case later. I can't use the this keyword

function GetbtnTEST(){
var panelbar = $find("<%= RadPanelBar1.ClientID %>");
var item = panelbar.findItemByValue("Travelers");//I need to find by value because we use language files for Text
var objBtn = item.findControl("ColorPicker");
alert(
'objBtn = ' + objBtn);//Always null!
}

Someone please help...this is driving me nuts!

jgig
Top achievements
Rank 1
 answered on 03 Oct 2008
1 answer
76 views
I have a problem using RadWindow. It blinks when I move the mouse cursor over it. Help me please.
Serrin
Top achievements
Rank 1
 answered on 03 Oct 2008
4 answers
202 views
Currently, one can link a detail (child) grid to a master (parent) grid using LINQ.  First, two LingDataSources are established for each grid and then linked together using the WhereParameters of the detail (child) LinqDataSource to identifying the key fields which are then linked to the master grid using the SelectedValue field.  One example from Northwind db is given below:

<asp:LinqDataSource ID="LinqDataSource1" runat="server" 
    ContextTypeName="NWExample.DataClasses1DataContext" 
    EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="Customers">  
</asp:LinqDataSource> 
 
<asp:LinqDataSource ID="LinqDataSource2" runat="server" 
    ContextTypeName="NWExample.DataClasses1DataContext" 
    EnableDelete="True" EnableInsert="True" EnableUpdate="True" TableName="Orders" 
    Where="CustomerID == @CustomerID">  
    <WhereParameters> 
        <asp:ControlParameter ControlID="RadGrid1" Name="CustomerID" 
        PropertyName="SelectedValues['CustomerID']" 
        Type="String" /> 
    </WhereParameters> 
</asp:LinqDataSource> 

To insert items into the detail grid, one needs to write some VB or C# code to place into the DataSource's InsertParameters a default value equal the SelectedValue of the master grid.  A recent update permits using RadGrid.SelectedValue['FieldName'] permitting use of a specific field linking the two grids.  Such as:

    Protected Sub RadGrid1_InsertCommand(ByVal source As ObjectByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.InsertCommand  
        If "Detail".Equals(e.Item.OwnerTableView.Name) Then 
            Dim parentItem As Telerik.Web.UI.GridDataItem = DirectCast(e.Item.OwnerTableView.ParentItem, Telerik.Web.UI.GridDataItem)  
            LinqDataSource2.InsertParameters("CustomerID").DefaultValue = parentItem.OwnerTableView.DataKeyValues(parentItem.ItemIndex)("CustomerID").ToString  
        End If 
    End Sub 

In the definition of InsertParameters for LINQ, I should be able to avoid using VB code using a "codeless" method.  For example, the LinqDataSource2 above should include the following

<InsertParameters> 
    <asp:ControlParameter ControlID="RadGrid1" Name="CustomerID" 
    PropertyName="SelectedValues['CustomerID']" Type="String" /> 
</InsertParameters> 

But I am not having success using this method.  When I try to insert a new record into the details grid, the value of CustomerID is not transfered to database but a "Null" value is supplied so I must use the VB code to set the default value of each InsertParameter.  Shouldn't the Insert, Update, Select, and Delete functions be able to access the RadGrid's SelectedValue fields?  Is this an issue with LINQ or with RadGrid?

I really like using "codeless" and allowing the intelligence of the components to interact together.  Please let me know where I my code is flawed.
Ceramist
Top achievements
Rank 1
 answered on 03 Oct 2008
3 answers
176 views
I have read and used info from this thread and all works just fine.

However I now need to trap, at client side, if the user clicks the "Add new row" link on the grid. To do this I added

<ClientSettings> 
    <ClientEvents  OnCommand="RaiseCommand" /> 
</ClientSettings> 

to my grid and then added some javascript to process the event:

    function RaiseCommand(sender, args) { 
 
        var cmd = args.get_commandName(); 
 
        if (cmd = 'InitInsert') { 
            var message = "Add new clicked.\n" + 
                    "Click OK to continue or Cancel to change your selection.\n"
            if (!confirm(message)) 
                return args.set_cancel(true
            else 
                return args.set_cancel(false); 
        } 
    } 

The javascript traps the event but the result is that the ItemCommand event at the server does not fire and the new default values for the check boxes are not set resulting in an error "Conversion from type DBNull to type Boolean is not valid".

If I remove the javascript I can add new rows without error and the ItemCommand event fires setting the default checkbox values.




Declan
Top achievements
Rank 2
 answered on 03 Oct 2008
2 answers
150 views

Update ---
figured it out.
Slap this into the DeleteCommand... 

Dim
ID As String = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)
(
"Your Data Key Name").ToString()
---End Update

well it is face slap wednesday and I am confused.
all i want to do is have 2 columns. cancel (link button) and select (link button)
I can trap the selected value (datakeyname) using the selectedindex.. but cannot for the life of me see how to get it when i use the cancel command. I can return 'cancelled' in the msglabel... however I cannot get the value of the row that I need to work with.

source

 <telerik:RadGrid  ID="RadGrid1" width="200px"  runat="server" GridLines="None">  
   <MasterTableView DataKeyNames="Pos_id">  
   <Columns> 
<telerik:GridButtonColumn CommandName="Delete"  ButtonType="LinkButton" Text="Cancel" UniqueName="CancelCol" /> 
 <telerik:GridButtonColumn  CommandName="Select" DataTextField="ListName" UniqueName="column1" /> 
     </Columns> 
        <RowIndicatorColumn> 
            <HeaderStyle Width="20px" /> 
        </RowIndicatorColumn> 
        <ExpandCollapseColumn> 
            <HeaderStyle Width="20px" /> 
        </ExpandCollapseColumn> 
     
   </MasterTableView> 
   <ClientSettings> 
   <Selecting AllowRowSelect="True" /> 
   </ClientSettings> 
                    </telerik:RadGrid> 

Code:

 
    Protected Sub RadGrid1_DeleteCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.DeleteCommand  
        Try  
            'Run a SQLNonQry to update data  
            'repopulate  
            msglabel.Text = RadGrid1.SelectedValue & " Cancelled "  
            populateGrid()  
        Catch ex As Exception  
            msglabel.Text = ex.Message  
        End Try  
    End Sub  
 
    Protected Sub RadGrid1_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGrid1.SelectedIndexChanged  
        'update related ascx form  
        Ctrls_frm_CreatePosting.posid = RadGrid1.SelectedValue  
        msglabel.Text = RadGrid1.SelectedValue & " Selected"  
 
    End Sub  
 
sub PopulateGrid()  
'basic grid populate with sql ds  
end sub  
 

mac
Top achievements
Rank 1
 answered on 03 Oct 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?