Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
67 views
Hi,

My main issue is that my insertCommand is only picking up (and inserting it) the top item from the combobox and NOT the "Selected Item".  What is missing in this code in order for my query to recognize the "Selected item " from my combobox.  Here are the relevant pieces of my code:

<SCRIPT runat="server">

 Sub On_Click(ByVal source As Object, ByVal e As EventArgs)
   
        SqlDataSource2.Insert()
 
 End Sub 'On_Click
</SCRIPT>

|
|
|
|-----------more code
|
|
|

        <tr>
            <td>
                Categroy:
            </td>
            <td>
                <telerik:RadComboBox ID="RadComboBox1" runat="server" DataSourceID="SqlDataSource2"
                    AppendDataBoundItems="true"
                      DataTextField="Category" DataValueField="CatId" Skin="Windows7"
                      DropDownWidth="298px" EmptyMessage="Choose a Category" HighlightTemplatedItems="true"
                            EnableLoadOnDemand="true" Filter="StartsWith" >
                            <HeaderTemplate>
                                <table style="width: 100px" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td style="width: 100px;">
                                            Category Id</td>
                                    </tr>
                                </table>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <table style="width: 100px" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td style="width: 100px;">
                                            <%# Eval("CatId")%>
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
               </telerik:RadComboBox>
            </td>
        </tr>

|
|
|
|-----------more code
|
|
|

        <tr>
            <td colspan="2">
                <br />
                <br />
                <asp:Button ID="btnAdd" runat="server" Text="Add New" OnClick="On_Click" />
            </td>
        </tr>

|
|
|
|-----------more code
|
|
|

    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:MUNTERSJMmlConnectionString %>"       
        SelectCommand="SELECT  MCategories.CatId FROM  MCategories"
        InsertCommand="INSERT INTO MProducts (CatId) VALUES (@CatId)">
        <insertParameters>
            <asp:ControlParameter Name="CatId" ControlId="RadComboBox1" PropertyName="SelectedValue" />
        </insertParameters>
    </asp:SqlDataSource>

Dimitar Terziev
Telerik team
 answered on 19 Apr 2011
1 answer
104 views
Hi,

My main issue is that my insertCommand is only picking up (and inserting it) the top item from the combobox and NOT the "Selected Item".  What is missing in this code in order for my query to recognize the "Selected item " from my combobox.  Here are the relevant pieces of my code:

<SCRIPT runat="server">

 Sub On_Click(ByVal source As Object, ByVal e As EventArgs)
   
        SqlDataSource2.Insert()
 
 End Sub 'On_Click
</SCRIPT>

|
|
|
|-----------more code
|
|
|

        <tr>
            <td>
                Categroy:
            </td>
            <td>
                <telerik:RadComboBox ID="RadComboBox1" runat="server" DataSourceID="SqlDataSource2"
                    AppendDataBoundItems="true"
                      DataTextField="Category" DataValueField="CatId" Skin="Windows7"
                      DropDownWidth="298px" EmptyMessage="Choose a Category" HighlightTemplatedItems="true"
                            EnableLoadOnDemand="true" Filter="StartsWith" >
                            <HeaderTemplate>
                                <table style="width: 100px" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td style="width: 100px;">
                                            Category Id</td>
                                    </tr>
                                </table>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <table style="width: 100px" cellspacing="0" cellpadding="0">
                                    <tr>
                                        <td style="width: 100px;">
                                            <%# Eval("CatId")%>
                                        </td>
                                    </tr>
                                </table>
                            </ItemTemplate>
               </telerik:RadComboBox>
            </td>
        </tr>

|
|
|
|-----------more code
|
|
|

        <tr>
            <td colspan="2">
                <br />
                <br />
                <asp:Button ID="btnAdd" runat="server" Text="Add New" OnClick="On_Click" />
            </td>
        </tr>

|
|
|
|-----------more code
|
|
|

    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:MUNTERSJMmlConnectionString %>"       
        SelectCommand="SELECT  MCategories.CatId FROM  MCategories"
        InsertCommand="INSERT INTO MProducts (CatId) VALUES (@CatId)">
        <insertParameters>
            <asp:ControlParameter Name="CatId" ControlId="RadComboBox1" PropertyName="SelectedValue" />
        </insertParameters>
    </asp:SqlDataSource>

Dimitar Terziev
Telerik team
 answered on 19 Apr 2011
1 answer
50 views
Hi,

I am not able to get the ID from the dropdown to do the insert of the new record based on that selected item from the that dropdown. 
So when I click the "Add file" no record is being saved to the database.

thanks



<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
  <telerik:RadFormDecorator 
                        ID="RadFormDecorator1" Runat="server" Skin="Windows7" DecoratedControls="Textbox" />
    <div style="padding-left:20px">
    <table width="90%" border="0" cellpadding="5" style="text-align:left">
         
        <tr>
            
            <td align="left">  <div style="font-size: 14pt; font-weight: bold;">
                    Add New Media
                </div>
            </td>  <td align="right" >
                <img src="../images/arrow_back.png" align="absmiddle" /> <asp:LinkButton ID="btnAddMedia" Font-Bold="false"   CausesValidation="false" runat="server" Text="Back to Listings" />
            </td>
        </tr>
         <tr>
            <td><div runat="server" id="successaddmsg" visible="false">
                <img src="../images/accept.png" align="absmiddle" /> 
                <asp:Label ID="Label1" runat="server" ForeColor="green"  Font-Bold="true" Font-Size="12px" Text="Media item was successfully added." />
            </div>
            </td>
            <td>
                <asp:CustomValidator ID="CustomValidator1" runat="server" ClientValidationFunction="validateRadUpload"
                    ErrorMessage="Please select at least one valid media file" fileOnServerValidate="CustomValidator1_ServerValidate" />
            </td>
        </tr>
        <tr>
            <td>
                Categroy:
            </td>
            <td>
                <telerik:RadComboBox ID="RadComboBox1" runat="server" DataSourceID="SqlDataSource2"
                    AppendDataBoundItems="true" DataTextField="Category" DataValueField="CatId" Skin="Windows7">
                    <Items>
                        <telerik:RadComboBoxItem />
                    </Items>
                </telerik:RadComboBox>
            </td>
        </tr>
        <tr>
            <td>
                Media File:
            </td>
            <td>
                <telerik:RadUpload ID="RadUpload1" runat="server" ControlObjectsVisibility="None"
                    Skin="Office2007">
                </telerik:RadUpload>
            </td>
        </tr>
        <tr>
            <td>
                Title:
            </td>
            <td>
                <asp:TextBox ID="txtTitle" Width="321px" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td>
                Comments:
            </td>
            <td>
                <asp:TextBox ID="txtDesc" Width="321px" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:CheckBox ID="chkShow" Checked="true" runat="server" Text="Make it available on User's Download Page." />
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <br />
                <br />
                <asp:Button ID="btnAdd" runat="server" Text="Add file" />
            </td>
        </tr>
    </table>
    </div>
    <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:MUNTERSJMmlConnectionString %>"
        SelectCommand="SELECT MediaCategories.CatId, MediaCategories.CatName AS Category FROM MediaCategories ORDER BY CatName ">
    </asp:SqlDataSource>
    <%--
      Upload Large File Setting Requirements:
      Open the file C:\Windows\System32\inetsrv\config\applicationHost.config and find the line:    
<section name="requestFiltering" overrideModeDefault="Deny" />
  
Set the overrideModeDefault property to Allow. So now the line should look like:
<section name="requestFiltering" overrideModeDefault="Allow" />
    --%>
</asp:Content>
Dimitar Terziev
Telerik team
 answered on 19 Apr 2011
1 answer
92 views

Hi, 


We using custom skin for rad controls. The scrollbar looks in IE and Firefox correct but not in google chrome. the result is the same on Telerik demo for rent a car which is a custom skin (clear).  See the attachment.  

Thanks
Regards 
Farid 
Bozhidar
Telerik team
 answered on 19 Apr 2011
6 answers
219 views
Good Day/Evening,

I'm having some problems with the setting the datasource of 3 radgrid controls each in it's own RadPageView in the Multipage for a tabstrip.

E.G

RadGridUsers
Column 1 Column 2 Column 3 SelectButton

TAB 1 | TAB 2 | TAB 3

MULTIPAGE
----------------
RADGrid1
----------------
RADGrid2
----------------
RADGrid3
----------------

Now what I'm doing is when I get a SelectedIndexChanged event from RadGridUsers, i want to set the RadGrid1,RadGrid2 and RadGrid3's datasource to Nothing (Null in C#) before I update the grids with new data. The problem I'm having is that the Grids Row Count of RadGrid1, RadGrid2 and RadGrid3 is still greater than 0 even after I set the datasource to Nothing.

Private Sub RadGridUsers_SelectedIndexChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadGridUsers.SelectedIndexChanged
 
'Clear all Grids of any previous account's data
RADGrid1.DataSource = Nothing
RADGrid1.DataBind()
RADGrid2.DataSource = Nothing
RADGrid2.DataBind()
RADGrid3.DataSource = Nothing
RADGrid3.DataBind()
 
Select Case TabStrip.SelectedTab.Text
Case "TAB 1"
     RADGrid1.Datasource = GetProfile
     RADGrid1.DataBind()
     Exit Select
Case "TAB 2"
     RADGrid2.Datasource = GetAddressDetails
     RADGrid1.DataBind()
     Exit Select
Case "TAB 3"
     RADGrid3.Datasource = GetOrderHistory
     RADGrid1.DataBind()
     Exit Select
End Select
 
End Sub

After I set all the RadGrid's Datasource to nothing and then only update the selected tabs RadGrid, I want the user to selecte another TAB (e.g TAB 3) and what I do then is check if the TAB3's RADGrid has any Items by doing this

Private Sub TabStrip_TabClick(ByVal sender As Object, ByVal e As Telerik.Web.UI.RadTabStripEventArgs) Handles TabStrip.TabClick
 
 Select Case e.Tab.Text
        Case "TAB1"
            If Not RadGrid1.Items.Count > 0 Then
                 RadGrid1.Datasource = GetProfile
            End If
        Case "TAB2"
            If Not RadGrid2.Items.Count > 0 Then
                 RadGrid2.Datasource = GetAddressDetails
            End If
        Case "TAB3"
            If Not RadGrid3.Items.Count > 0 Then
                 RadGrid3.Datasource = GetOrderHistory
            End If
 End Select
End Sub

My Problem is that the item count is always greater than 0 even after I've set the Datasource to Nothing and then did a RadGrid.DataBind.

Your help would be much appreicated.
Helen
Telerik team
 answered on 19 Apr 2011
2 answers
124 views
Is there a way I can utilize the skinning functionality for the RadWindow, but instead of keeping the CSS files in the /skins/ folder (/skins/Window.css and /skins/MySkin/Window.MySkin.css), merge them into my site CSS file?  I am working on site optimization and I would like to remove the 2 extra server calls.
Mark
Top achievements
Rank 1
 answered on 19 Apr 2011
2 answers
38 views

My grid contains the following: I want to be able to control the displaying of the image button based on whether there are any detail records in the code behind, some records will have detail data and some will not.  What event do I need to use and how do I set its property to visible or not visible?

Thanks

 

 

<MasterTableView Width="100%" DataKeyNames="Odline" HierarchyLoadMode="Client"

 

 

 

 

ExpandCollapseColumn-ButtonType="ImageButton"

 

 

 

 

ExpandCollapseColumn-CollapseImageUrl="hide.bmp"

 

 

 

 

ExpandCollapseColumn-ExpandImageUrl="detail.bmp" >

 

 

John
Top achievements
Rank 1
 answered on 19 Apr 2011
2 answers
95 views

I am using a vertical bar chart and want to be able to set the value of the start and end value of ChartMarkedZone, is that posible in the code behind?

I am using version: Telerik WebUI VSExtensions   2011.01.315.0

Thanks
John
Top achievements
Rank 1
 answered on 19 Apr 2011
1 answer
127 views
Hello,

I had downloaded sharepoint acceleration kit but its not installing on my pc
its saying that installation package is not supported by this processor type.contact your product vender
pls reply soon for the above issue..and if possible pls provide dll for the same..

thanks..
Andrey
Telerik team
 answered on 19 Apr 2011
0 answers
74 views
I try this demo Window / RadWindow And MDI and this work good but in my case I have in my page an ajaxified grid when grid refresh with ajax, I can't see my radwindow when i click on tabstrip tab. If I check javascript function function OnClientTabSelected(sender, args)I have no error and my win object is not null but i don't see anything. Do you have an idea ? Possible problem with zindex calcul ?

Thanks
ericc34
Top achievements
Rank 1
 asked on 19 Apr 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
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?