Inside Grid

3 posts, 1 answers
  1. Jonathan Rajotte
    Jonathan Rajotte avatar
    82 posts
    Member since:
    Oct 2005

    Posted 11 Feb 2008 Link to this post

    Hi,
    I am trying to put a slidder within my Grid, it shows up correctly, but it is not editable as I would like it to be.  Here is my code:

    <web:RadGrid ID="gvPlacementAtClientsCriteria" runat="server" Width="100%" AllowPaging="false" AllowSorting="false" GridLines="None">  
            <ClientSettings ApplyStylesOnClient="True">  
                <Selecting AllowRowSelect="True"></Selecting> 
            </ClientSettings> 
            <MasterTableView CssClass="MasterTable" DataKeyNames="Id" AllowMultiColumnSorting="True" Width="100%">  
                <Columns> 
                    <rad:GridBoundColumn DataField="Id" UniqueName="Id" ReadOnly="True">  
                        <headerstyle width="10px" /> 
                        <itemstyle horizontalalign="Center" /> 
                    </rad:GridBoundColumn> 
                    <rad:GridTemplateColumn HeaderText="Client Name">  
                        <headerstyle width="300px" /> 
                        <ItemTemplate> 
                            <asp:DropDownList ID="ddlClient" runat="server" /> 
                        </ItemTemplate> 
                    </rad:GridTemplateColumn> 
                    <rad:GridBoundColumn DataField="Percentage" HeaderText="%" ReadOnly="True">  
                        <headerstyle width="20px" /> 
                        <itemstyle horizontalalign="Center" /> 
                    </rad:GridBoundColumn> 
                    <rad:GridTemplateColumn HeaderText="Distribution">  
                        <headerstyle width="200px" /> 
                        <ItemTemplate> 
                            <tk:RadSlider ID="radSlider1" runat="server" MinimumValue="0" MaximumValue="100" Orientation="Horizontal"></tk:RadSlider> 
                        </ItemTemplate> 
                    </rad:GridTemplateColumn> 
                    <rad:GridTemplateColumn HeaderImageUrl="~/Images/lock.gif" UniqueName="Locked">  
                        <itemtemplate> 
                            <asp:CheckBox ID="ckbLocked" runat="server"></asp:CheckBox> 
                        </itemtemplate> 
                        <headerstyle width="10px" /> 
                        <itemstyle horizontalalign="Center" /> 
                    </rad:GridTemplateColumn> 
                </Columns> 
            </MasterTableView> 
        </web:RadGrid> 
     


    Thanks for your help,
    Jonahtan

  2. Jonathan Rajotte
    Jonathan Rajotte avatar
    82 posts
    Member since:
    Oct 2005

    Posted 12 Feb 2008 Link to this post

    More info:

    The problem is not for a slider within a grid.  Trying outside the grid was giving me the same problem. 

    The real problem is when the the slider is within a div with the display style is originally set to 'none'.  After some javascript event, the div display is set to 'block' which shows the slider.  But the slider cannot be update normally.

    Is this a known bug?  Is there a workaround?
    Jonathan
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Answer
    Petio Petkov
    Admin
    Petio Petkov avatar
    825 posts

    Posted 13 Feb 2008 Link to this post

    Hi Jonathan Rajotte,

    You should invoke RadSlider.Redraw() method once you set the display:block.You can find a simple example, which illustrates how to show the slider which is in div with display:none below:

     
    <html xmlns="http://www.w3.org/1999/xhtml" > 
    <head id="Head1" runat="server">  
        <title>Untitled Page</title> 
        <script type="text/javascript">  
         function ShowDiv()  
         {          
               $get("div1").style.display = "block";  
               $find("RadSlider2").Redraw();          
         }  
        </script> 
    </head> 
    <body> 
        <form id="form1" runat="server"><asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 
        <div> 
        <input type="button" onclick="ShowDiv()" value="showDiv" /> 
        <div id="div1" style="background-color:Green;width:600px;height:600px;display:none">  
            <telerik:RadSlider ID="RadSlider2" runat="server" Skin="Default2006" Length="400" 
             /> 
        </div>    
          
        </div> 
        </form> 
    </body> 
    </html> 
     

    If you have any other questions let us know.

    Sincerely yours,
    Petio Petkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
Back to Top