This is a migrated thread and some comments may be shown as answers.

Inside Grid

2 Answers 116 Views
Slider
This is a migrated thread and some comments may be shown as answers.
Jonathan Rajotte
Top achievements
Rank 1
Jonathan Rajotte asked on 11 Feb 2008, 10:06 PM

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 Answers, 1 is accepted

Sort by
0
Jonathan Rajotte
Top achievements
Rank 1
answered on 12 Feb 2008, 04:21 PM
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
0
Accepted
Petio Petkov
Telerik team
answered on 13 Feb 2008, 12:12 PM
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
Tags
Slider
Asked by
Jonathan Rajotte
Top achievements
Rank 1
Answers by
Jonathan Rajotte
Top achievements
Rank 1
Petio Petkov
Telerik team
Share this question
or