Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
69 views
When I drag a file over the upload text, it will show a section with text "Drop files here". Is there a way to customize the section style such as backgroud-color, padding-top, padding-left?
Princy
Top achievements
Rank 2
 answered on 22 Aug 2012
4 answers
453 views
Hi,

I am using asp.net 2.0.

Protected Sub RadGrid1_ItemCommand(ByVal source As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.ItemCommand
        If e.CommandName = "RowClick" Then
            Dim item As GridDataItem = e.Item
            selUserid = item("UserId").Text
            TxtName.Text = item("Name").Text
            TxtUserName.Text = item("UserName").Text
            TxtEmail.Text = item("Email").Text
            TxtPassword.Text = item("Password").Text 
            TxtPhone.Text = item("UserPhone").Text
            cmbCity.Text = item("PosId").Text
        End If
    End Sub


The password textbox is in password mode, but by clicking on grid all the textboxes are filled with values except password textbox.

Can any body help me out.

Thanks in advance
Shinu
Top achievements
Rank 2
 answered on 22 Aug 2012
1 answer
174 views
I'm binding a RadGrid to a BindingList, when I edit a Template column with a dropDown I'm trying  it to keep the previously selected value

here is a sample of my code:

<telerik:GridTemplateColumn HeaderText="Contributor" UniqueName="Contributor" DataField="Contrib">
    <EditItemTemplate>
        <asp:DropDownList ID="ddContributor" runat="server" DataSourceID="ldsContibutors"
        DataTextField="ContributorName" DataValueField="ContributorID" AppendDataBoundItems="True"
        SelectedValue='<%# Eval("Contrib.ContributorID") %>'>
            <asp:ListItem>Select a value</asp:ListItem>
        </asp:DropDownList>
    </EditItemTemplate>
    <ItemTemplate>
        <%# Eval("Contrib.ContributorName") %>
    </ItemTemplate>


eval works fine but bind throws an exception: DataBinding: 'Telerik.Web.UI.GridInsertionObject' does not contain a property with the name 'Contrib'.


I also tried in cs but I cannot find the value in the item["Contributor"].Text 
then I tried witha a label in the Item template,  ((Label)item["Contributor"].findControl("labelID")).Text but it's always ""
any help will be apreciated thanks!
Princy
Top achievements
Rank 2
 answered on 22 Aug 2012
1 answer
148 views
I have this code in the Pre Render event in one of my RadGrids.............



 For Each item As GridDataItem In Radgrid_AddRemoveProvider.MasterTableView.Items
            Dim lblPID As Label = DirectCast(item.FindControl("lblPID"), Label)

            Dim btnAddProvider As LinkButton = DirectCast(item.FindControl("btnAddProvider"), LinkButton)
            Dim btnRemoveProvider As LinkButton = DirectCast(item.FindControl("btnRemoveProvider"), LinkButton)
            Dim lblFullName As Label = DirectCast(item.FindControl("lblFullName"), Label)
            Dim btnFullName As LinkButton = DirectCast(item.FindControl("btnFullName"), LinkButton)
            '  Dim lblContactType As Label = DirectCast(item.FindControl("lblContactType"), Label)
            ' Dim ddPreferredContact As DropDownList = DirectCast(item.FindControl("ddPreferredContact"), DropDownList)

            If lblPID.Text = Nothing Then
                btnAddProvider.Visible = True
                'ddPreferredContact.Visible = True
                'lblContactType.Visible = False
                btnRemoveProvider.Visible = False
                lblFullName.Visible = True
                btnFullName.Visible = False
            ElseIf lblPID.Text <> Nothing Then
                btnAddProvider.Visible = False
                'ddPreferredContact.Visible = False
                'lblContactType.Visible = True
                btnRemoveProvider.Visible = True
                lblFullName.Visible = False
                btnFullName.Visible = True
            End If

Next



However it loops through this code 100 times looping through each item in my RadGrid.  The problem is that it goes through this loop every time I perform any sort of event on the page.  Is there anyway I can tell it to stop looping through this code when i am not working with this RadGrid on the page.  I tried putting the code in the ItemCreated event, but it does the same thing. Overall I believe this is effecting the performance and speed of my page. 
Shinu
Top achievements
Rank 2
 answered on 22 Aug 2012
1 answer
57 views
Hi,

I am using radgrid and in itemtempalte I have a dropdownlist and a label control. OnItemDatabound event I am passing the ids of dropdownlist and a label control to a javascript function. The functions finds the client ids of the dropdownlist and a label control but when I use document.getElementbyId for label control it gives me null.

Any help would be really appreciated.

Thanks



function OnSelectedIndexChange(ddlTopic, lblTopic) {
 
       alert(ddlTopic);
       alert(lblTopic);
       var ddl = document.getElementById(ddlTopic);
       var lbl = document.getElementById(lblTopic); // The problem occurs here 
       alert(lbl);  
       ddl.style.display = "none";       
        
 
   }
 
 
 
 
<telerik:RadGrid ID="gvTopics" runat="server" Font-Names="Verdana" Font-Size="XX-Small"
                   Skin="Outlook" EnableEmbeddedSkins="true" GridLines="Vertical" AllowSorting="true"
                   AllowPaging="true" Width="99%" CellPadding="2" AutoGenerateColumns="False">
                   <MasterTableView CommandItemDisplay="Top">
                       <CommandItemSettings ShowAddNewRecordButton="false" />
                       <Columns>
<telerik:GridTemplateColumn SortExpression="Topic" HeaderText="Topic">
                               <ItemTemplate>
                                   <asp:LinkButton ID="lnkTopic" Text='<%# Bind("Topic") %>' runat="server"></asp:LinkButton>
                                   <telerik:RadToolTip ID="rttpTopics" Width="350" Height="100" HideEvent="ManualClose"
                                       TargetControlID="lnkTopic" RelativeTo="Element" Skin="Windows7" Position="TopRight"
                                       ManualClose="true" ShowEvent="OnClick" runat="server">
                                       <table width="100%">
                                           <tr>
                                               <td width="40%">
                                                   select topic :
                                               </td>
                                               <td>
                                                   <asp:DropDownList ID="ddlTopic" runat="server" Font-Names="Verdana" Font-Size="XX-Small"
                                                       ValidationGroup="selecttopic" AutoPostBack="false" />
                                                    <asp:RequiredFieldValidator ID="rfvTopic" runat="server" ErrorMessage="## please select a topic"
                                                       InitialValue="- please select -" ControlToValidate="ddlTopic" Font-Bold="True"
                                                       Font-Names="Arial" Font-Size="X-Small" SetFocusOnError="True" ValidationGroup="selecttopic" />
                                                   <telerik:RadTextBox ID="rtbTopicName" EmptyMessage="please enter topic name"
                                                       runat="server">
                                                   </telerik:RadTextBox>
                                                   <asp:Label ID="lblTopicName" Text="TopicName" Visible="false" runat="server"></asp:Label>
                                               </td>
                                           </tr>
                                           <tr>
                                               <td>
                                               </td>
                                               <td>
                                                   <asp:Button ID="btnSaveTopic" CommandArgument='<%# Container.DataItem("id")%>' ValidationGroup="selecttopic"
                                                       CausesValidation="true" OnClick="btnSaveTopic_Click" Text="Save" runat="server" />
                                               </td>
                                           </tr>
                                       </table>
                                   </telerik:RadToolTip>
                               </ItemTemplate>
                           </telerik:GridTemplateColumn>
</Columns>
                       <NoRecordsTemplate>
                           <asp:Label ID="Label5" runat="server" Text="no topics found"></asp:Label>
                       </NoRecordsTemplate>
                   </MasterTableView>
               </telerik:RadGrid>
 
 
 
Protected Sub gvTopics_OnItemDataBound(ByVal sender As Object, ByVal e As GridItemEventArgs) Handles gvTopics.ItemDataBound
 
       If TypeOf (e.Item) Is GridDataItem Then
 
           Dim ddlTopic As DropDownList = e.Item.FindControl("ddlTopic")
           Dim lblTopicName As Label = e.Item.FindControl("lblTopicName")
           ddlTopic.Attributes.Add("onChange", "return OnSelectedIndexChange('" & ddlTopic.ClientID & "','" & lblTopicName.ClientID & "');")
 
   End Sub
Shinu
Top achievements
Rank 2
 answered on 22 Aug 2012
2 answers
75 views
Hi,

I need a help regarding the Read menu with WCF and radgrid. 

I have a red grid with template column. In Template column there is a RedMenu. That rad menu items will be desided (when expand get from WCF service) . I followed the link below. It worked well.  

http://www.telerik.com/help/aspnet-ajax/menu-items-wcf-service.html.

But in my case I need to pass data from the row in DataGrid to WCF service. For example will assume grid containes Order details and column with "Order Number". I need to pass the "Order Number" to the WCF method as done in above sample.

sample has done this using js method as follows.

function OnClientItemPopulatingHandler(sender, e) 
    {        
        var context = e.get_context();
        //using jQuery to get the checked item and pass it to the server        
        context["ProductSuite"] = $telerik.$("input[name='rblSuites']:checked").val();
    }

I need to do this as follows

function OnClientItemPopulatingHandler(sender, e) 
    {        
        var context = e.get_context();
        //using jQuery to get the checked item and pass it to the server        
        context["OrderNumber"] = GET THE ORDER NUMBER FROM ROW BELONGS TO THE RADMENU.
    }

can anybody help me to resolve this ?

Thank you
Dinesh
Top achievements
Rank 1
 answered on 22 Aug 2012
1 answer
38 views
Good afternoon friends of telerik! I am new in the area of programming ... and I would like an example (code) how can I do to select the lines of my RadGrid via a Checkbox ...



Thank you for the attention!

Shinu
Top achievements
Rank 2
 answered on 22 Aug 2012
3 answers
192 views
How to set css for the radbutton so that it is displayed as image?
Princy
Top achievements
Rank 2
 answered on 22 Aug 2012
2 answers
140 views
Hi, 

I've just published a website I've developed (using Visual Studion 2010 using .NET 4.0) in my IIS Server. I have two pages I'm testing: the Login page which does not contain any Telerik controls and another page to which I am directed after logging in. This second page now contains Telerik controls.

Unfortunately, the page is not rendered at all and I'm getting this error instead. 

An unhandled exception occured...

Error Message: Object reference not set to an instance of an object.
Stack Trace: at Telerik.Web.UI.ScriptEntrySlot.GetSerializedAssemblyInfo(ScriptEntry scriptEntry) at Telerik.Web.UI.ScriptEntryUrlBuilder.TryAddScriptEntry(ScriptEntry scriptEntry) at Telerik.Web.UI.ScriptEntryUrlBuilder.RegisterScriptEntry(ScriptEntry scriptEntry) at System.Web.UI.ScriptManager.RegisterScripts() at System.Web.UI.ScriptManager.OnPagePreRenderComplete(Object sender, EventArgs e) at System.EventHandler.Invoke(Object sender, EventArgs e) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Is there something you could suggest that I could check or change?
Daryl
Top achievements
Rank 1
 answered on 22 Aug 2012
6 answers
64 views
Hi

I am using PanelBar as a 2-level menu, and have set ExpandMode="SingleExpandedItem"  PersistStateInCookie="True" and this works as expected.

However, I would like to have the open item close when the user clicks another top level menu item even if the clicked item does NOT have any child items in it. 

How can I achieve this behaviour?  Can someone help with this?  

I need to achieve this because I realize after user testing that it is the user expectation!

Thanks

Clive
Clive Hoggar
Top achievements
Rank 1
 answered on 21 Aug 2012
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?