Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
167 views
I'm relatively new to Telerik, ASP.NET and VB so please bear with me.

I'm trying to build an admin page which will allow the user to change various properties drawn from a database.  I've got it working fine as far as getting/setting values to textboxes and now I'm trying to substitute in more specific UI elements such as color pickers and numeric text boxes.

As it stands the admin page uses a control, each control containing some table markup and a Placeholder element.  My thought was that I could attach correct UI widget based on the type of the control, but I can't get this to work.

In Page_Prerender of the control, the widgets are created and attached to the placeholder.  My problem comes in getting the changed values from these widgets when the user selects save.  It doesn't need to be as each setting is changed.

How should I go about getting these values back out?  I tried retrieving the value by getting the widget from the Placeholder's controls collection, but it only seems to include elements place in the placeholder in the markup, not those added in the code-behind.

Thank you for any help you can provide.
Ryan
Top achievements
Rank 1
 answered on 05 Aug 2011
4 answers
192 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
59 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
248 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
169 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
88 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
327 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
123 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
157 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
150 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
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?