Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
138 views
As my grid is following http://www.telerik.com/DEMOS/ASPNET/Prometheus/Grid/Examples/DataEditing/TemplateFormUpdate/DefaultVB.aspx to do, and I try to insert the FileUpload into  FormTemplate, when I click insert, that's a problem on it

   Protected Sub RadGrid1_ItemInserted(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.InsertCommand  
 
             Dim Id As String = "1" 'I am not sure how to get the primary key when insert  
             Dim PhotoFile As FileUpload = CType(RadGrid1.FindControl("PhotoFileUpload"), FileUpload)' I think the findcontrol has a problem, but not sure how to modify  
            InsertedShoperPhoto(Id, PhotoFile)  
    End Sub 

    Public Sub InsertedShoperPhoto(ByVal Id As String, ByVal PhotoFile As FileUpload)  
        If (PhotoFile Is Nothing) Or (Not PhotoFile.HasFile) Then Return  
        Dim fileLen As Integer  
        fileLen = PhotoFile.PostedFile.ContentLength  
        Dim Input(fileLen) As Byte  
        Input = PhotoFile.FileBytes  
 
        Using cn As New SqlConnection(ConfigurationManager.ConnectionStrings("PLAZAConnectionString").ConnectionString)  
            Using cmd As New SqlCommand("UPDATE ShoperDetail SET Picture = @Photo WHERE spID = @Id", cn)  
                cmd.Parameters.Add("@Id", Data.SqlDbType.NVarChar, 10).Value = Id 
                cmd.Parameters.Add("@Photo", Data.SqlDbType.Image).Value = Input 
                cn.Open()  
                cmd.ExecuteNonQuery()  
            End Using  
        End Using  
    End Sub 


And the other thing, there's two radcombobox and two sqldatasources inside the FormTemplate, there also have a problem when I run

    <telerik:RadComboBox ID="RadComboBox1" runat="server" DataSourceID="SqlDataSource3" 
                                                    DataTextField="STname" DataValueField="STname" RadComboBoxImagePosition="Right" 
                                                    Skin="WebBlue" SelectedValue='<%# Bind("ShopType", "{0}") %>'>  
                                                    <CollapseAnimation Duration="200" Type="OutQuint" /> 
                                                    <ExpandAnimation Type="OutQuart" /> 
                                                </telerik:RadComboBox> 
<asp:SqlDataSource ID="SqlDataSource3" runat="server" ConnectionString="<%$ ConnectionStrings:PLAZAConnectionString %>" SelectCommand="SELECT DISTINCT [STname] FROM [ShopType]">  
        </asp:SqlDataSource> 

And the second combobox, it will check what client selected in combobox1, and bind this combobox.
 <telerik:RadComboBox ID="RadComboBox2" runat="server" DataSourceID="SqlDataSource4" 
                                                    DataTextField="STCategory" DataValueField="STCategory" RadComboBoxImagePosition="Right" 
                                                    Skin="WebBlue" SelectedValue='<%# Bind("ShopCat", "{0}") %>'>  
                                                    <CollapseAnimation Duration="200" Type="OutQuint" /> 
                                                    <ExpandAnimation Type="OutQuart" /> 
                                                </telerik:RadComboBox> 
<asp:SqlDataSource ID="SqlDataSource4" runat="server" ConnectionString="<%$ ConnectionStrings:PLAZAConnectionString %>" SelectCommand="SELECT [STCategory] FROM [ShopType] WHERE ([STname] = @STname)">  
            <SelectParameters> 
                <asp:ControlParameter ControlID="RadComboBox2" DefaultValue="Shopping" Name="STname" 
                    PropertyName="SelectedValue" Type="String" /> 
            </SelectParameters> 
        </asp:SqlDataSource> 



Vlad
Telerik team
 answered on 25 Mar 2008
1 answer
59 views
I'm sure I'm missing something simple, but...

I have 3 radComboBoxes on an ascx I use in DotNetNuke. Only the first control is enabled when I try to use them.
            <table> 
            <tr><td>Client : </td><td><telerik:RadComboBox ID="radComboBoxClient" runat="server"> 
                </telerik:RadComboBox></td></tr> 
            <tr><td>Contact : </td><td><telerik:RadComboBox ID="radComboBoxContact" runat="server"> 
                </telerik:RadComboBox></td></tr> 
            <tr><td>Owner : </td><td><telerik:RadComboBox ID="radComboBoxOwner" runat="server"> 
                </telerik:RadComboBox></td></tr> 
         </table> 

So what I need to know is how to have all 3 comboboxes enabled when the page loads.

Many thanks for any pointers on this.
Paul
Telerik team
 answered on 25 Mar 2008
1 answer
139 views
Is it possible to refresh a grid in the parent page without closing the window?
FL-Developer
Top achievements
Rank 1
 answered on 25 Mar 2008
1 answer
255 views
Hi,
 
I have  a RadComboBox(Prometheus ver Q3 1425) with multiple colums:

ASP:

<telerik:RadComboBox ID="RadComboBox1" runat="server" RadComboBoxImagePosition="Right" Width="391px" AutoPostBack="True" OnItemDataBound="RadComboBox1_ItemDataBound" OnDataBinding="RadComboBox1_DataBinding"
OnSelectedIndexChanged
="RadComboBox1_SelectedIndexChanged">
<CollapseAnimation Duration="200" Type="OutQuint"
/>
<ExpandAnimation Type="OutQuart"
/>
</telerik:RadComboBox
>



C#:

protected void RadComboBox1_SelectedIndexChanged(object o, Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs e)
{
User currentUser = Session["USER"] as User;
currentUser.IdUser = mIdInv;
ctrlEditionInscription.IdInv = mIdInv;
}

The ComboBox display correctly but the event SelectedIndexChanged wont fire, any idea ?

thanks
J-Francois
Jean-Francois
Top achievements
Rank 1
 answered on 24 Mar 2008
2 answers
228 views
I realize this may not be specific to the radcombobox but I need to reset the selected value of a combobox after the page postsback.  Normally I would just do a page redirect at this point but the page is in a radwindow so that option is out.

I have tried just about everything I can think of.  The page always reloads with the last selected value.

I have tried disabling viewstate, setting the selectedindex = -1, .ClearSelection().

I want the user to be able to fill out the page, submit the page, and then fill it out again but I need the values to be reset.  I can reset textboxes, checkboxes, and the other controls but not the combobox.

Any ideas?

Thanks
Curt
Top achievements
Rank 1
 answered on 24 Mar 2008
2 answers
348 views
Hi -

My apologies if this is covered elsewhere, but after wading through RadGrid and API documentation I'm still left puzzled...

I'm trying to better understand group expansion and collapsing.

First, what is the <ExpandCollapseColumn> item for in the <MasterTableView> section? By default, even with grouping enabled, its "Visible" property is set to false - yet the ExpandCollapseColumn is still visible. Why? (I'm assuming - perhaps wrongly - that the ExpandCollapseColumn is the column with the "+" or "-" image in it.)

So how do I hide the ExpandCollapseColumn? I've read about how others have hidden the image in the column, but how do you just remove/hide the whole column?

My second question is about two items in the <Columns> section of <MasterTableView>: What are <telerik:GridExpandColumn> and <telerik:GridGroupSplitterColumn> used for?
(And therefore how does <telerik:GridExpandColumn> differ from the <ExpandCollapseColumn> outside the <Columns> section?)

Many thanks,

Jake.
Jake
Top achievements
Rank 1
 answered on 24 Mar 2008
8 answers
538 views
I would like to rebind bound RadComboBoxes when insertions or deletions have occurred, however I get this error:
Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control. 

A typical RadComboBox declaration
                                <telerik:RadComboBox  
                                    ID="cmbCity" 
                                    runat="server" 
                                    DataSourceID="srcAllCity" 
                                    CssClass="rowtbxedit" 
                                    RadComboBoxImagePosition="Right" 
                                    Width="200px" 
                                    DataTextField="City" 
                                    DataValueField="City" 
                                    Skin="Office2007" 
                                    ShowDropDownOnTextboxClick="False"   
                                    text='<%# Bind("City") %>' 
                                    AllowCustomtext="false" 
                                    MarkFirstMatch="true" 
                                > 
                                    <CollapseAnimation type="OutQuint" duration="200"></CollapseAnimation> 
                                    <ExpandAnimation type="OutQuart"></ExpandAnimation> 
                                </telerik:RadComboBox> 

                <asp:SqlDataSource  
                    id="srcAllCity" 
                    SelectCommand="SELECT City FROM qryAllCities ORDER BY City"   
                    ConnectionString="<%$ ConnectionStrings:RentalSQL %>"   
                    runat="server" 
                 /> 
 
 

since this doesn't work, how do I get the comboboxes to repopulate? 
Veselin Vasilev
Telerik team
 answered on 24 Mar 2008
1 answer
125 views
Hi

I'm using Windows Vista, VS2008, C#.

When trying to remove an item from the combobox by:

    combo.get_items().removeAt(index);

I get the following error:
    "Object doesn't support this property of method'

What's particularly strange is that this method will show in the Watch window when dubugging Javascript.

I can call other member functions (e.g. combo.get_items().get_count()), just not this one.

Is there something I'm doing wrong?


Kind regards

Mark Eaton
Paul
Telerik team
 answered on 24 Mar 2008
6 answers
215 views
            function OnRowContextMenuCabinet(sender, eventArgs)  
            {  
                var rgCabinets = $find("<%= rgCabinets.MasterTableView.ClientID %>");  
                rgCabinets.selectItem(eventArgs.get_itemIndexHierarchical());               
            }  
 
                <telerik:radgrid id="rgCabinets" runat="server" datasourceid="sdsOFC_Cabinets" gridlines="None" 
                    skin="Vista" AllowPaging="True" PageSize="14">  
 
                    <MasterTableView DataSourceID="sdsOFC_Cabinets" AutoGenerateColumns="False"   
                            CommandItemDisplay="Top" ClientDataKeyNames="CabinetID">  
                        <Columns> 
                            <telerik:GridBoundColumn DataField="CabinetName" UniqueName="CabinetName" SortExpression="CabinetName" HeaderText="Cabinet Name"></telerik:GridBoundColumn> 
                            <telerik:GridTemplateColumn UniqueName="CabinetTemplateEditColumn">  
                                <ItemTemplate> 
                                    <asp:HyperLink ID="EditLink" runat="server" Text="Edit" /> 
                                </ItemTemplate> 
                            </telerik:GridTemplateColumn> 
                            <telerik:GridTemplateColumn UniqueName="CabinetTemplateDeleteColumn">  
                                <ItemTemplate> 
                                    <asp:HyperLink ID="DeleteLink" runat="server" Text="Delete" /> 
                                </ItemTemplate> 
                            </telerik:GridTemplateColumn> 
                        </Columns> 
 
                        <CommandItemTemplate> 
                            <a href="#" onclick="return ShowCabinetInsertForm();">Add A Cabinet</a> 
                        </CommandItemTemplate> 
                        <ExpandCollapseColumn Resizable="False" Visible="False">  
                            <HeaderStyle Width="20px" /> 
                        </ExpandCollapseColumn> 
                        <RowIndicatorColumn Visible="False">  
                            <HeaderStyle Width="20px" /> 
                        </RowIndicatorColumn> 
                    </MasterTableView> 
                      
                    <ClientSettings> 
                        <ClientEvents OnRowContextMenu="OnRowContextMenuCabinet" /> 
                        <Selecting AllowRowSelect="true" /> 
                    </ClientSettings> 
                </telerik:radgrid> 
 
        <!-- Cabinets Context Menu --> 
        <telerik:RadContextMenu ID="rmCabinets" runat="server" Skin="Default2006" OnClientItemClicked="OnClickCabinet">  
            <Targets> 
                <telerik:ContextMenuControlTarget ControlID="rgCabinets" /> 
            </Targets> 
            <Items> 
                <telerik:RadMenuItem runat="server" Text="Edit" Value="Edit">  
                </telerik:RadMenuItem> 
                <telerik:RadMenuItem runat="server" Text="Delete" Value="Delete">  
                </telerik:RadMenuItem> 
            </Items> 
        </telerik:RadContextMenu> 
 

I have a number of RadGrids which all have a context menu assigned to them.  When the grid is updated via an AJAX request, whether it is call I make or simply navigating to the next set of records, the context menu is lost/does not execute when called.

Any ideas?

Seth
Seth
Top achievements
Rank 1
 answered on 24 Mar 2008
1 answer
101 views

My layout is following;

Select Item: <dropdown>

[Menu1] [menu2] [Menu3]....


When I open the combo box, everything is fine but for another machine (same IE browser) the drop down content does not overlap the menu below it. the drop down should overlap menu and it does it on my browser.

What could be the issue? Any way to fix it? should i use Z-Index?

-Piyush


Simon
Telerik team
 answered on 24 Mar 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?