Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
211 views
Hi All,
        I have a dropdown in radgrid1.  I would like to populate another radgrid based on dropdownselected item. How can i do that.
The dropdownlist is in edit mode in radgrid1.  Please help me....

Thanks in advance
Iana Tsolova
Telerik team
 answered on 18 Feb 2010
1 answer
267 views
I have a Radgrid with 2 columns SKU,ModelNumber...and a select command button in each row of the grid.When I select each row the values should be passed on to another screen...Below is the code I used...I am getting an error at Dim SKU as string value which says "Object reference not set to an instance of object"...can any one explain me how should I correct my code??????

Public

 

Event RowClicked(ByVal SKUvalue As String, ByVal modelNumber As String)

 

 

Protected Sub rgridModelList_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles rgridModelList.ItemCommand

 

 

 

If e.CommandName = "Select" Then

 

 

Dim SKU As String = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("SKU").ToString

 

 

Dim ModelNumber As String = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)("ModelNumber").ToString

 

 

RaiseEvent RowClicked(SKU, ModelNumber)

 

 

End If

 

 

End Sub

 

Shinu
Top achievements
Rank 2
 answered on 18 Feb 2010
1 answer
202 views
hi my dear friends

i have a little problem about using jquery...(i reeally do not know jquery but i forced to use it)

i am using vs 2008 - asp.net web app with c#

also i am using telerik controls in my pages

also i am using sqldatasources (Connecting to storedprocedures) in my pages

my pages base on master and content pages and in content pages i have mutiviews

=================================================================================

in one of the views(inside one of those multiviews)i had made two radcombo boxes for country and city requirement like cascading dropdowns as parent and child combo boxes. i used old way for doing that , i mean i used update panel and in the SelectedIndexChange Event of Parent RadComboBox(Country) i Wrote this code :

    protected void RadcomboboxCountry_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) 
     
    { 
     
    hfSelectedCo_ID.Value = RadcomboboxCountry.SelectedValue; 
     
    RadcomboboxCity.Items.Clear(); 
     
    RadcomboboxCity.Items.Add(new RadComboBoxItem(" ...""5")); 
     
    RadcomboboxCity.DataBind(); 
     
    RadcomboboxCity.SelectedIndex = 0; 
     
    } 


my child radcombo box can fill by upper code , let me tell you how : the child sqldatasource have a sp that has a parameter and i fill that parameter by this line -> hfSelectedCo_ID.Value = RadcbCoNameInInsert.SelectedValue;
RadcbCoNameInInsert.SelectedValue means country ID.

after doing that SelectedIndexChange Event of Parent RadComboBox(Country) could not be fire therefore i forced to set the autopostback property to true.

afetr doing that every thing was ok until some one told me can u control focus and keydown of your radcombo boxes

(when u press enter key on the parent combobox[country] , so child combobox gets focus -- and when u press upperkey on child radcombobox [city], so parent combobox[country] gets focus)

(For Users That Do Not Want To Use Mouse for Input Info And Choose items)

i told him this is web app , not win form and we can not do that. i googled it and i found jquery the only way for doing that ... so i started using jquery . i wrote this code with jquery for both of them :

    <script src="../JQuery/jquery-1.4.1.js" language="javascript" type="text/javascript"></script> 
     
    <script type="text/javascript"
     
    $(function() { 
     
    $('input[id$=RadcomboboxCountry_Input]').focus(); 
     
    $('input[id$=RadcomboboxCountry_Input]').select(); 
     
    $('input[id$=RadcomboboxCountry_Input]').bind('keyup', function(e) { 
     
    var code = (e.keyCode ? e.keyCode : e.which); 
     
    if (code == 13) {    -----------> Enter Key 
     
    $('input[id$=RadcomboboxCity_Input]').focus(); 
     
    $('input[id$=RadcomboboxCity_Input]').select(); 
     
    } 
     
    }); 
     
    $('input[id$=RadcomboboxCity_Input]').bind('keyup', function(e) { 
     
    var code = (e.keyCode ? e.keyCode : e.which); 
     
    if (code == 38) {       -----------> Upper Key 
     
    $('input[id$=RadcomboboxCountry_Input]').focus(); 
     
    $('input[id$=RadcomboboxCountry_Input]').select(); 
     
    } 
     
    }); 
     
    }); 
     
    </script> 


this jquery code worked BBBBBBUUUUUUUTTTTTT autopostback=true of the Parent RadComboBox Became A Problem , Because when SelectedIndex Change Of ParentRadComboBox is fired after that Telerik Skins runs and after that i lost parent ComboBox Focus and we should use mouse but we don't want it....

for fix this problem i decided to set autopostback of perentCB to false and convert

 
   protected void RadcomboboxCountry_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e) 
     
    { 
     
    hfSelectedCo_ID.Value = RadcomboboxCountry.SelectedValue; 
     
    RadcomboboxCity.Items.Clear(); 
     
    RadcomboboxCity.Items.Add(new RadComboBoxItem(" ...""5")); 
     
    RadcomboboxCity.DataBind(); 
     
    RadcomboboxCity.SelectedIndex = 0; 
     
    } 


to a public non static method without parameters and call it with jquey like this : (i used onclientchanged property of parentcombo box like onclientchanged = "MyMethodForParentCB_InJquery();" insread of selectedindexchange event)

 
   public void MyMethodForParentCB_InCodeBehind() 
     
    { 
     
     
     
    hfSelectedCo_ID.Value = RadcomboboxCountry.SelectedValue; 
     
    RadcomboboxCity.Items.Clear(); 
     
    RadcomboboxCity.Items.Add(new RadComboBoxItem(" ...""5")); 
     
    RadcomboboxCity.DataBind(); 
     
    RadcomboboxCity.SelectedIndex = 0; 
     
    } 


for doing that i read the blow manual and do that step by step :

=======================================================================



http://www.ajaxprojects.com/ajax/tutorialdetails.php?itemid=732




=======================================================================

but this manual is  about static methods and this is my new problem ...

when i am using static method like :
 
    public static void MyMethodForParentCB_InCodeBehind() 
     
    { 
     
     
     
    hfSelectedCo_ID.Value = RadcomboboxCountry.SelectedValue; 
     
    RadcomboboxCity.Items.Clear(); 
     
    RadcomboboxCity.Items.Add(new RadComboBoxItem(" ...""5")); 
     
    RadcomboboxCity.DataBind(); 
     
    RadcomboboxCity.SelectedIndex = 0; 
     
    } 


so i recieved some errors and this method could not recognize my controls and hidden field...

one of those errors like this :

Error 2 An object reference is required for the non-static field, method, or property 'Darman.SuperAdmin.Users.hfSelectedCo_ID' C:\Javad\Copy of Darman 6\Darman\SuperAdmin\Users.aspx.cs 231 13 Darman

any idea or is there any way to call non static methods with jquery

(i know we can not do that but is there another way to solve my problem)???????????????


Majid Darab
Top achievements
Rank 1
 answered on 18 Feb 2010
3 answers
182 views
Hello... ^^

help me please..

i want week tooltip hide..


jaewung i
Top achievements
Rank 1
 answered on 18 Feb 2010
2 answers
307 views
Hi,
    I am using RadNumericTextBox inside the <edititemtemplate> tag of a RadGrid. I have set autopostback property of RadNumericTextBox to false.  Still when I press Enter key postback happens.  Given below is my code:

 <telerik:RadGrid ID="grdTrans" GridLines="None"  AutoGenerateColumns="false" Height="500px"
           AutoGenerateEditColumn="false" AutoGenerateDeleteColumn="false"
           runat="server"  OnCancelCommand="grdTrans_CancelCommand"
           AllowPaging="false" AllowSorting="false"
           OnDeleteCommand="grdTrans_DeleteCommand"  OnUpdateCommand="grdTrans_UpdateCommand"
           onneeddatasource="grdTrans_NeedDataSource"
           oninsertcommand="grdTrans_InsertCommand"
           onitemdatabound="grdTrans_ItemDataBound"
           oneditcommand="grdTrans_EditCommand" >
            <MasterTableView Name="master"  EditMode="InPlace" GridLines="None" DataKeyNames="accid" CommandItemDisplay="Bottom" >
                <Columns>
                  <telerik:GridEditCommandColumn>
                   </telerik:GridEditCommandColumn>

<telerik:GridTemplateColumn  HeaderText="Debit" UniqueName="debit" DataType="System.Decimal" ItemStyle-Width="100px" ItemStyle-HorizontalAlign="Right" >
                        <ItemTemplate>
                                       <asp:Label ID="lblDbAmt" Text= '<%# Eval("dbamt") %>' CssClass="labels"   runat="server"> </asp:Label>
                        </ItemTemplate>
           
                       <EditItemTemplate>
                              <telerik:RadNumericTextBox ID="txtDbAmt" Text  = '<%# bind("dbamt") %>' MinValue="0" MaxValue="99999999.99" MaxLength="11" DataType="System.Decimal" Culture="en-GB"  AutoPostBack="false" ClientEvents-OnKeyPress="KeyPressed" EnabledStyle-HorizontalAlign="Right" runat="server">                   
                            <NumberFormat AllowRounding="false" DecimalDigits="2" DecimalSeparator="." GroupSeparator="," GroupSizes="3"   />
                             </telerik:RadNumericTextBox>            
           
                       </EditItemTemplate>
 </telerik:GridTemplateColumn>   

I had to use the following javascript function to avoid postback:
 function KeyPressed(ctrl, e) {
             if (e.get_domEvent().rawEvent.keyCode == 13) { //enter  
                 //special handling (focus other control and so on) here  
                 e.get_domEvent().preventDefault();
                 e.get_domEvent().stopPropagation();
             }

Is there any workaround other than using the above javascript.

Alphonse



alphonse joseph
Top achievements
Rank 1
 answered on 18 Feb 2010
1 answer
106 views
please i want a way to get the dataset of the grid after sorting and filtering the data
Tsvetoslav
Telerik team
 answered on 18 Feb 2010
1 answer
106 views
Anybody know how to hide the refresh button so that user only sees the add new button?
Shinu
Top achievements
Rank 2
 answered on 18 Feb 2010
1 answer
94 views
We have just upgraded from 2009 Q2 to 2009 Q3 and have come across a nasty inconsistency. All of our toolbars which have dropdown or split button are not rendering images correctly on the dropdown lists. In the sample attached, you can see that the images in the list are offset too far to the left and subsequently get cut off. I tried fixing this with a custom skin but I'm not really sure what I'm doing.
Peter
Top achievements
Rank 1
 answered on 18 Feb 2010
1 answer
273 views
We just downloaded the Telerik ASP.net AJAX controls and are starting to integrate them into an existing, non-AJAX web application.  However something keeps inserting a reference to the old version 1.0 of the System.Web.Extensions library into the project which in turn causes us to get the following error:

The type 'System.Web.UI.ScriptManager' is ambiguous: it could come from assembly 'C:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\3.5.0.0__31bf3856ad364e35\System.Web.Extensions.dll' or from assembly 'C:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\1.0.61025.0__31bf3856ad364e35\System.Web.Extensions.dll'. Please specify the assembly explicitly in the type name.

Everything works fine for awhile if I edit the web.config file and remove the following line:
<add assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>

However that assembly reference line gets inserted again as soon as I edit any of the controls in the VS Design surface.

Can anyone point me at what may be causing Visual Studio 2005 to keep inserting that assembly reference?


Thank you.








Shawn Smiley
Top achievements
Rank 1
 answered on 18 Feb 2010
1 answer
196 views
How would I change the background of a specific row on a server side and a client side. I would like to do it in two ways, one with an image and another way with standard color code.
Thank you very much.
Erwin Floresca
Top achievements
Rank 1
 answered on 17 Feb 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?