Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
166 views
I am needing the user to be able to select their email address in the DropDownList menu, be presented with ListBox selections and when they move the selections to the second listbox window, their UserId and Email Address are saved into the database along with their ListBox selection. I am having difficulty with the datakeyfield, datatextfield, DataValueField setup in the controls. I setup the two labels to ensure I get the proper return from the DropDown menu prior to moving the ListBox selection. I have tried all available values but seem to get the UserId in both the Email and ID columns or vice-versa. Please help.
_ JT

Hi Dimitar,
Sorry for the lack of clairity. The issue is definately with the RadListBox. The 2 labels will show the correct selected values for Email & UserID (as ID), when a selection is made in the drop-down menu. The problem is that I need to have those 2 values submitted to the database, along with the selected Name value, when the Name selection goes from RadListBox1 to RadListBox2 by the user.

Thanks,
_ JT 

<telerik:radajaxloadingpanel runat="server" id="RadAjaxLoadingPanel1" skin="Office2007" />
<telerik:radajaxpanel runat="server" id="RadAjaxPanel1" loadingpanelid="RadAjaxLoadingPanel1">
    <!-- ---------------------------------------------------------------------- -->
    <!-- DropDownList control start ----------------------------------------------- -->
    <!-- ---------------------------------------------------------------------- -->
    <asp:sqldatasource id="SqlDataSource2" connectionstring="<%$ ConnectionStrings:IPdataConnectionString %>"
        providername="System.Data.SqlClient" selectcommand="SELECT DISTINCT Email, UserId as ID FROM [aspnet_Membership]"
        runat="server"></asp:sqldatasource>
    <label for="EmailDDN">
        <asp:label id="Label2" runat="server" class="text">Select Email: </asp:label>
    </label>
    <asp:dropdownlist id="EmailDDN" runat="server" autopostback="True" datasourceid="SqlDataSource2"
        appenddatabounditems="True" datakeyfield="ID" datatextfield="Email" datavaluefield="Email" 
        onselectedindexchanged="DDN_SelectedIndexChanged">
        <asp:listitem>
         Select your email address
        </asp:listitem>
    </asp:dropdownlist>
    <br />
    <asp:label id="EmailLabel1" runat="server">Selected Email: </asp:label>
    <br />
    <asp:label id="EmailLabel2" runat="server">Selected Value: </asp:label>
    <br />
    <!-- ------------------------------------------------------------------ -->
    <!-- ---------------------------------------------------------------------- -->
    <!-- ListBox control start -------------------------------------------- -->
    <telerik:radlistbox runat="server" id="RadListBox1" skin="Office2007" datasourceid="SourceDataSource"
        allowautomaticupdates="true" datakeyfield="ID" datatextfield="Name" DataValueField="ID"
        height="200px" allowtransfer="true" transfertoid="RadListBox2" transfermode="Copy" width="230px"
        autopostbackontransfer="true" />
    <telerik:radlistbox runat="server" id="RadListBox2" datasourceid="DestinationDataSource"
        allowautomaticupdates="true" datakeyfield="ID" datatextfield="Name" DataValueField="ID"
        height="200px" allowreorder="true" autopostbackonreorder="true" allowdelete="True" width="230px"
        autopostbackondelete="true" />
    <asp:sqldatasource id="SourceDataSource" runat="server" connectionstring="<%$ ConnectionStrings:IPdataConnectionString %>"
        providername="System.Data.SqlClient" 
        deletecommand="DELETE FROM Products WHERE ID = @ID"
        insertcommand="INSERT INTO Products (Name, ID, Email) VALUES (@Name, @ID, @Email)"
        selectcommand="SELECT Name, ID FROM Products" 
        updatecommand="UPDATE Products SET Name = @Name, Email = @Email WHERE ID = @ID">
        <deleteparameters>
            <asp:parameter name="ID" type="Int32" />
        </deleteparameters>
        <insertparameters>
            <asp:parameter name="Name" type="String" />
            <asp:controlparameter name="Email" propertyname="SelectedValue" controlid="EmailDDN" type="String" />
            <asp:controlparameter name="ID" propertyname="SelectedValue" controlid="EmailDDN" type="String" />
        </insertparameters>
        <selectparameters>
            <asp:controlparameter name="Email" controlid="EmailDDN" propertyname="SelectedValue" type="String" />
            <asp:controlparameter name="ID" propertyname="SelectedValue" controlid="EmailDDN" type="String" />
        </selectparameters>
        <updateparameters>
            <asp:parameter name="Name" type="String" />
            <asp:controlparameter name="Email" propertyname="SelectedValue" controlid="EmailDDN" type="String" />
            <asp:controlparameter name="ID" propertyname="SelectedValue" controlid="EmailDDN" type="String" />
        </updateparameters>
    </asp:sqldatasource>
    <asp:sqldatasource id="DestinationDataSource" runat="server" connectionstring="<%$ ConnectionStrings:IPdataConnectionString %>"
        providername="System.Data.SqlClient" 
        deletecommand="DELETE FROM ProductsMail WHERE ID = @ID"
        insertcommand="INSERT INTO ProductsMail (Name, Email, ID) VALUES (@Name, @Email, @ID)"
        selectcommand="SELECT Name, ID, Email FROM ProductsMail" 
        updatecommand="UPDATE ProductsMail SET Name = @Name, Email = @Email WHERE ID = @ID">
        <deleteparameters>
            <asp:parameter name="ID" type="Int32" />
        </deleteparameters>
        <insertparameters>
            <asp:parameter name="Name" type="String" />
            <asp:controlparameter name="Email" propertyname="SelectedValue" controlid="EmailDDN" type="String" />
            <asp:controlparameter name="ID" propertyname="SelectedValue" controlid="EmailDDN" type="String" />
        </insertparameters>
        <updateparameters>
            <asp:parameter name="Name" type="String" />
            <asp:controlparameter name="Email" propertyname="SelectedValue" controlid="EmailDDN" type="String" />
            <asp:controlparameter name="ID" propertyname="SelectedValue" controlid="EmailDDN" type="String" />
        </updateparameters>
    </asp:sqldatasource>
</telerik:radajaxpanel>

====

 

 

protected void DDN_SelectedIndexChanged(System.Object sender, System.EventArgs e)

 

{

EmailLabel1.Text = EmailDDN.SelectedItem.ToString();

EmailLabel2.Text = EmailDDN.SelectedValue.ToString();

}



John
Top achievements
Rank 1
 answered on 05 Aug 2011
1 answer
46 views
I have run into an issue I was wondering if someone can help me out or let me know if it's not possible.  I have built a dynamic RadGrid on a page that needs to be Excel like with all of the rows to be in edit mode.  I have set the grid's MasterTableView.EditMode to InPlace and on binding I loop through and add all the EditIndexs for the rows.  This works and I have a nice grid with textboxes.  What I'm struggling with is that when a user updates a cell and then moves off of the row we would like to update that row via a web service call from the code behind.  Is there an easy way to do this?  Without a post back being triggered the only thing I can think of is to use javascript.  Any helpful advice would be appreciated.
Radoslav
Telerik team
 answered on 05 Aug 2011
9 answers
221 views
Hi,

I have a Radgrid on a page, and I have implemented a custom skin.
<telerik:RadGrid ID="JobsGrid" runat="server" AutoGenerateColumns="False"
   CellSpacing="0" AllowSorting="True"
   EnableEmbeddedSkins="False" GroupingEnabled="False" SkinID="XLogixBlue" >
   <ClientSettings>
     <Selecting AllowRowSelect="True" EnableDragToSelectRows="False" />

The page is derived from a Master page, and all the skins css files are included on the Master page.
However, when the page is rendered, the source does not reference my custom skin, but the default skin instead, as below
    <div id="GridContainer" style="position: absolute; width: 920px; height: 400px; left: 10px; top: 10px">
  
      <div id="ctl00_maincontentarea_JobsGrid" class="RadGrid RadGrid_Default">
  
<table cellspacing="0" class="rgMasterTable" id="ctl00_maincontentarea_JobsGrid_ctl00" style="width:100%;table-layout:auto;empty-cells:show;">
    <colgroup>
        <col  />
        <col  />
        <col  />
        <col  />
        <col  />

There is a Menu on the same page which is working fine.
I have tried including the CSS files directly within the child page, and that did not help either.

I am using the Q2 2011 release.

Thankyou

Paul
Paul
Top achievements
Rank 1
 answered on 05 Aug 2011
5 answers
147 views
I set my crop size to 300 by 100 using the dialog. I move the crop rectangle, and the width in the dialog changes to 298 and the height to 112. This is in IE.  Is there a fix?
Niko
Telerik team
 answered on 05 Aug 2011
2 answers
72 views
This is a small thing, and we've lived with it for 8 months, but can anyone shead any light on this.

To enabme be to make tweaks to the looks of the controls I routinely make a copy of the skin I want, and rename it to match my project. This all works fine, except...With the Slider if I use the embedded skin it looks fine, but if I copy the skin rename it to match my project, and change the markup such that externalSkin = true I get the slider cut off 1px short.

I have included 2 images that show the 1px problem along with the markup and the CSS. you can see in the 2 images that the CSS is rendered slightly differently and the internal skin has a width of 9px, and the copy has a width of 8.
This width comes from the webresource file so I cant just change it in the copied CSS file.

Andy
Andy Green
Top achievements
Rank 2
 answered on 05 Aug 2011
5 answers
287 views
Hi @

We are using Radbuttons through out the application. But we have a reusable component which has asp:buttons and <input type="button".

Is there anyway by which I can make these buttons looks similar to Telerik Buttons?

Thanks In advance.
Bozhidar
Telerik team
 answered on 05 Aug 2011
2 answers
107 views
Hi

How can I Set Value and Text members from DataSource in Bound RadGrid?

The code:
const string sSql = "SPl_JUIZOS";
SqlConnection oConnection = new SqlConnection(ConfigurationManager.ConnectionStrings["ApplicationServices"].ConnectionString);
SqlDataAdapter oAdapter = new SqlDataAdapter(sSql, oConnection);
DataTable oDataTable = new DataTable();
 
 
GridJuizos.DataSource = oDataTable;


Tks
Bruno
Top achievements
Rank 1
 answered on 05 Aug 2011
1 answer
136 views
I know there are a couple examples of this but none of them fit my exact situation and I need to solve this problem quickly.  Please help.

I have a page with a a radwindow that pops up.  Inside the radwindow are a few controls but the ones that come into play are an image button, a combobox and a listbox.  The combobox is filled with a list of many items that can be easily searched using the autofill feature.  The listbox has the same list of items.  Once the user finds the item he is looking for, the user clicks the image button and the list box is supposed to selects the same item and autoscroll to that item so the user can then select multiple items after the selected item.

I am able to do all of this except have the listbox autoscroll to the item and show it visibly in the list box.

The code I found that I think is close to what I need uses this javascript:

        Sys.Application.add_load(function (e) {
            var item = $find("lstAllGroups").get_selectedItem();
 
            if (item)
                item.scrollIntoView();

The problem I am having is the control called lstAllGroups can't be found and I don't know how to activate the javascript from the code behind.

If you would be able to supply a complete example of this, I would be grateful.

RJ
Ivan Zhekov
Telerik team
 answered on 05 Aug 2011
1 answer
124 views
Hi,

I was wondering if the set_text() client API call is intended to persist that value to the server on a postback.  I am working on an adaptation of the single-click button example in the demonstrations.  In the sample, the button text is set to something like "Processing..." in the OnClientClicked event, and then is returned to the previous value by the OnReponseEnd function of the RadAjaxManager.

The example we are trying to write is not Ajax enabled, so we expect the button to be placed back to its original value by virtue of the postback resetting the value to whatever was defined on the server side.  We have been using this method with a standard ASP button that works fine when setting the .value property on the client side.

Using RadButton, though, setting set_text() appears to persist this value back to the server, and so then it is not changed back to the server-defined value when the post refreshes.  Is there a way to keep that value from being posted back to the server or some other workaround?

Thanks,
Joel
Kevin
Top achievements
Rank 2
 answered on 05 Aug 2011
1 answer
95 views
Hi every one.

I had Telerik 2009 before, and now i update it to 2011.
i have some projects in 2009 and i Change one of them to telerik 2011 manualy.(I Deleted Telerik.Web.UI.dll From BIn and refrences and Put one component in one page that made 2011 DLL and then i add id to refrence manualy from bin folder. but when i create new website it has Telerik.Web.UI.dll.refresh file, but in my previews web applications, Telerik didnt make this file. just Telerik.Web.UI.dll )

I have a strange problem in my menu. in one page of the project that i have a menu in it, it dont show submenus and shows a script error in IE!

its my menu :

 

 

<telerik:RadMenu ID="FarsiMenu" runat="server" DataFieldParentID="MenuParentID" DataNavigateUrlField="AdminValue" DataSourceID="sdsMenuBuilder" DataTextField="MenuText" DataValueField="Value" DataFieldID="MenuID" Width="650px" onprerender="FarsiMenu_PreRender">

 

 

 

</telerik:RadMenu>

 


Its my SqlDataSource :

<

 

 

asp:SqlDataSource ID="sdsMenuBuilder" runat="server"

 

 

 

ConnectionString="<%$ ConnectionStrings:ArminShopConnectionString %>" DeleteCommand="Delete tDynamicMenu

 

Where MenuID=@MenuID"

 

 

InsertCommand="Insert tDynamicMenu (MenuParentID,MenuText,Lang,ShopID,OrderMenu)

 

Values(@MenuParentID,@MenuText,1,@ShopID,@OrderMenu)

"

 

 

ProviderName="<%$ ConnectionStrings:ArminShopConnectionString.ProviderName %>" SelectCommand="Select * From tDynamicMenu

 

Where Lang = 1 And ShopID = @ShopID

Order By OrderMenu"

 

 

UpdateCommand="Update tDynamicMenu

 

Set MenuText=@MenuText ,OrderMenu=@OrderMenu

Where MenuID=@MenuID And ShopID=@ShopID">

 

 

<SelectParameters>

 

 

 

<asp:ControlParameter ControlID="lblShopID" Name="ShopID" PropertyName="Text" />

 

 

 

</SelectParameters>

 

 

 

<DeleteParameters>

 

 

 

<asp:Parameter Name="MenuID" />

 

 

 

</DeleteParameters>

 

 

 

<UpdateParameters>

 

 

 

<asp:Parameter Name="MenuID" />

 

 

 

<asp:ControlParameter ControlID="lblShopID" Name="ShopID" PropertyName="Text" />

 

 

 

</UpdateParameters>

 

 

 

<InsertParameters>

 

 

 

<asp:ControlParameter ControlID="lblShopID" Name="ShopID" PropertyName="Text" />

 

 

 

<asp:Parameter Name="MenuParentID" />

 

 

 

<asp:Parameter Name="MenuText" />

 

 

 

<asp:Parameter Name="OrderMenu" />

 

 

 

</InsertParameters>

 

 

 

</asp:SqlDataSource>

 



And it is FarsiMenu_PreRender function :

using

 

 

Telerik.Web.UI;

 


 

 

protected void FarsiMenu_PreRender(object sender, EventArgs e)

 

{

 

 

try

 

{

 

 

foreach (RadMenuItem rootItem in FarsiMenu.Items)

 

{

rootItem.Attributes.Add(

 

"style", "cursor:pointer");// for root tems

 

SubMenuF(rootItem);

}

}

 

 

catch (Exception)

 

{

}

}

 

 

protected void SubMenuF(RadMenuItem MenuItem)

 

{

 

 

try

 

{

 

 

foreach (RadMenuItem childItem in MenuItem.Items)

 

{

childItem.Attributes.Add(

 

"style", "cursor:pointer");//for child items

 

SubMenuF(childItem);

}

}

 

 

catch (Exception)

 

{

}

}

Any help or suggestion plz? and any better suggestion for convert project better ?
Thanks in Advance.

Dimitar Terziev
Telerik team
 answered on 05 Aug 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Cynthia
Top achievements
Rank 1
Iron
Toby
Top achievements
Rank 3
Iron
Iron
Iron
Danielle
Top achievements
Rank 1
Iron
Iron
Joel
Top achievements
Rank 3
Bronze
Bronze
Iron
yw
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?