Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
29 views
I have a complex problem:

I have in my Grid a GridTemplatecolumn which displays the text " rapport " but this text must be visible only for some lines

The condition to enable or disable the visibility is within the second if

protected void GridDisplayOldRDV_ItemDataBound(object sender, GridItemEventArgs e)
{
 
    HiddenField HiddenFieldIdParticipant = e.Item.FindControl("HiddenFieldIdParticipant") as HiddenField;
    Utilisateur utilisateur = (Utilisateur)Session["utilisateur"];
    if (HiddenFieldIdParticipant != null)
    {
         if (utilisateur.idUtilisateur.ToString() != HiddenFieldIdParticipant.Value.ToString())
        {
            GridDisplayOldRDV.MasterTableView.GetColumn("Debriefing").Visible = false;
        }
    }
}


Right now , my problem is with this line :
GridDisplayOldRDV.MasterTableView.GetColumn("Debriefing").Visible = false;

The column disappears everytime...

I hope i'm clear enough

Thanks in advance for your help

Adigard
Top achievements
Rank 1
 answered on 09 Nov 2011
2 answers
80 views
Hi guys,
I Was working On Rad Grid recently with 5 columns in it , i was able to perform grouping  successfully by dragging and placing on top of rad grid,
but when i changed my prog and placed around 40 columns , i was not able to perform grouping..
when ever i try to drag a column always first column getting grouped.. and also i am not able to reorder by columns..

Any solutions..?
 
     <telerik:RadGrid ID="RadGrid1" runat="server" GridLines="None" Skin="Black" 
      OnNeedDataSource="RadGrid1_NeedDataSource" Width="784px"
        OnColumnDblClick="Radgrid1_OnColumnDblClick" AllowAutomaticDeletes="True" OnGroupsChanging="RadGrid1_GroupsChanging"
      AutoGenerateColumns="False" OnColumnsReorder="RadGrid1_ColumnsReorder"
      ShowFooter="True" AllowPaging="True"
       onpageindexchanged="RadGrid1_PageIndexChanged"
       onitemdatabound="RadGrid1_ItemDataBound"
       onpagesizechanged="RadGrid1_PageSizeChanged"
       onsortcommand="RadGrid1_SortCommand1" CellSpacing="0"  >
                          
   <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
    </HeaderContextMenu>
                              
              <MasterTableView>
            <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
            </RowIndicatorColumn>
            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
            </ExpandCollapseColumn>
           <HeaderStyle Width="150" />
                         
        <Columns>
        
 
        <telerik:GridBoundColumn DataField="Name" FilterControlAltText="Filter column column"
                                          HeaderText=" Name" UniqueName="column">
                                      </telerik:GridBoundColumn>
                                  
         <telerik:GridBoundColumn DataField="dept id" FilterControlAltText="Filter column column"
                                          HeaderText="dept_id" UniqueName="column">
                                      </telerik:GridBoundColumn>
                                              
                                              
                                                          --
                                                          --
                                 (40 colums like this..)
                 
        </Columns>
                                  <EditFormSettings>
                                      <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                      </EditColumn>
                                  </EditFormSettings>
                              </MasterTableView>
                              <FilterMenu EnableImageSprites="False">
                              </FilterMenu>
                              <GroupingSettings ShowUnGroupButton="true" />
                              <ClientSettings EnableRowHoverStyle="true" AllowDragToGroup="True" AllowColumnsReorder="true"
                                  AllowColumnHide="True" AllowKeyboardNavigation="True" AllowRowsDragDrop="True"
                                  ReorderColumnsOnClient="True">
<Selecting AllowRowSelect="True" />
                                  <ClientEvents OnColumnContextMenu="ColumnContextMenu" />
                                  <Scrolling AllowScroll="True" UseStaticHeaders="True" />
                                  <Resizing AllowColumnResize="true" EnableRealTimeResize="True" ResizeGridOnColumnResize="True" />
                              </ClientSettings>
                          </telerik:RadGrid>

Any solutions...???
 
Radoslav
Telerik team
 answered on 09 Nov 2011
4 answers
101 views
Hi,
I want to disable bacskapce (going to previous page) in radwindows.
So I added js code:

function getKey(keyStroke) {
            var t = window.event.srcElement.type;
            var keyCode = (document.layers) ? keyStroke.which : event.keyCode;
            var keyString = String.fromCharCode(keyCode).toLowerCase();
            var leftArrowKey = 37;
            var backSpaceKey = 8;
            var escKey = 27;
            if (t && (t == 'text' || t == 'textarea' || t == 'file')) {
                //do not cancel the event
            } else {
                if ((window.event.altKey && window.event.keyCode == leftArrowKey) || (keyCode == escKey) || (keyCode == backSpaceKey)) {
                    alert(keyCode);
                    return false;
                }
            }
        }

<body onkeydown="getKey()">...
but it doesn't work (alert is showing, but "false"doesn't stop going to previous page). Is any specific approach in radwindows to achieve the target?
Thanks.
wnl
Top achievements
Rank 1
 answered on 09 Nov 2011
4 answers
105 views
Hi,

When using the slider I am noticing some odd behaviour.  I have a set of criteria 1-5 and in the database I store which one of them was chosen.  Now If I use the code as below with the database value of 1, the second entry in the list is selected, setting the value in the database to 0 (which in practice it should never be) causes the first item to be selected.  It's almost as if the slider is treating the value as a 0 based array index.... Any ideas?  Code follows:

<telerik:RadSlider ID="uxOQC_1" runat="server"  DbValue='<%# Bind("OQC_1") %>' MinimumValue="1" MaximumValue="5" ItemType="Item" TrackPosition="Center">
   <Items>
       <telerik:RadSliderItem Text="Strongly disagree" Value="1" ToolTip="Strongly disagree" runat="server"></telerik:RadSliderItem>
       <telerik:RadSliderItem Text="Disagree" Value="2" ToolTip="Disagree" runat="server"></telerik:RadSliderItem>
       <telerik:RadSliderItem Text="Neither agree nor disagree" Value="3" ToolTip="Neither agree nor disagree" runat="server"></telerik:RadSliderItem>
       <telerik:RadSliderItem Text="Agree" Value="4" ToolTip="Agree" runat="server"></telerik:RadSliderItem>
       <telerik:RadSliderItem Text="Strongly agree" Value="5" ToolTip="Strongly agree" runat="server"></telerik:RadSliderItem>
   </Items>
</telerik:RadSlider>


Jon
Top achievements
Rank 1
 answered on 09 Nov 2011
2 answers
32 views
After adding Telerik dll version 11.2 to the project,i am not able to use combobox and radcalendar.After Postback,the ComboBox becomes freezed,and even when click on the Grid to insert record in it( by using inline inserion in the grid) the data which entered into the textboxes goes off and makes them blank.
Please help

With Regards,
Nishant Garg
Nishant
Top achievements
Rank 1
 answered on 09 Nov 2011
5 answers
186 views
Recently I had the need to put a RadComboBox on a page to display a drop down and noticed something quirky which made me have to rethink my layout to work around this odd issue.

If I place a RadComboBox as follows, everything works normal:
<div>
     <telerik:RadComboBox ID="ComboBox" runat="server">
          ... items
     </telerik:RadComboBox>
</div>

But the second I add "float: left;" as a css style as so then the RadComboBox behaves a little differently:
<div style="float: left;"
     <telerik:RadComboBox ID="ComboBox" runat="server"
          ... items 
     </telerik:RadComboBox
</div>

What normally happens is you are able to highlight and/or click anywhere on the combobox and your items will drop down so you can select something. With float: left; enabled in the div tag all of a sudden I can no longer drop down the combobox if I highlight and click on the image area of the combobox. That is the little down-arrow icon. I can highlight/click in the text area, but the area off to the right displaying the arrow icon becomes useless.

The only solution I have found to work is to avoid this scenario and rethink the layout.

Is anyone else able to replicate this quirk? I am using ver: 2010.3.1109.40

Thanks!
Kate
Telerik team
 answered on 09 Nov 2011
1 answer
71 views
Hi,

We are using latest version of Telerik.Web.UI.dll (2011.2.1011.40) in our project and currently i am facing an issue related to Telerik RadGrid display!

During the initial load, grid displays as expected but after a post back (i.e. click of Edit button in grid which displays another panel in same page and click of Cancel button in the displayed panel) the grid displays without any Skin/Theme. Attached is the screen shot for reference.

In another screen, this problem occurs during initial load of the grid.

Please let me know if i am missing out anything and help me resolve this unique issue.

Thanks,
Krishna Samaga B.
Pavlina
Telerik team
 answered on 09 Nov 2011
2 answers
90 views
Hello guys,
I have a web control that holds RadDockLayout control as a property:
public class DockZonesContainer : Control
{
    private Telerik.Web.UI.RadDockLayout _layout;


In my control  I am trying to dynamically create DocZone and add it to the  RadDockLayout  control.
when I'm trying to load my page I get this error:

Page cannot be null. Please ensure that this operation is being performed in the context of an ASP.NET request.


on this source code:
public override void RenderControl(HtmlTextWriter writer)
{
    _layout.RenderControl(writer);
}


BTW
when I try to add a simple asp label. I got no errors.

Please advise.
Thanks


Guy Kolbis
Top achievements
Rank 1
 answered on 09 Nov 2011
3 answers
208 views
Hi, I have a radgrid with one template column with a icon. I need to add a tooltips that will display a picture.

In the ItemDataBound of the grid I update the column icon and set a tooltip and add this tooltip in the page with a panel. This part work good, the tooltip popup with the text "TEST". Now I when to use the OnAjaxUpdate of the radToolTipsManager to display a picture insted of the text. I cant fire this function. I think the link are not made between the tooltip and the tooltipsmanager. For example I set the skin Web20Orange in the Tooltipsmanager but the tooltip fired in the ragrid are with the default skin. Any idea?

VB
    Protected Sub RadGrid1_ItemDataBound(ByVal sender As ObjectByVal e As GridItemEventArgs)  
        If TypeOf e.Item Is GridDataItem Then 
            Dim Photo As System.Web.UI.WebControls.Image = CType(e.Item.FindControl("Photo"), System.Web.UI.WebControls.Image)  
 
 
 
            If DataBinder.Eval(e.Item.DataItem, "Photo") = True Then 
                Photo.ID = DataBinder.Eval(e.Item.DataItem, "ID")  
                Photo.ImageUrl = "/Images/Photo.gif" 
                Photo.ImageAlign = System.Web.UI.WebControls.ImageAlign.AbsMiddle  
                Photo.Style.Add("vertical-align""middle")  
                Photo.BorderWidth = Unit.Pixel(0)  
 
                Dim monTooltips As New RadToolTip  
                monTooltips.ID = Guid.NewGuid.ToString  
                monTooltips.TargetControlID = DataBinder.Eval(e.Item.DataItem, "ID")  
                monTooltips.RelativeTo = ToolTipRelativeDisplay.Element  
                monTooltips.Position = ToolTipPosition.MiddleRight  
                monTooltips.Text = "Test" 
                Panel1.Controls.Add(monTooltips)  
            Else 
                Photo.ImageUrl = "/Gestion/Images/16X16/Blank.gif" 
                Photo.AlternateText = "" 
                Photo.ImageAlign = System.Web.UI.WebControls.ImageAlign.AbsMiddle  
                Photo.Style.Add("vertical-align""middle")  
                Photo.BorderWidth = Unit.Pixel(0)  
            End If 
        End If 
    End Sub 
 
ASPX
    <div style="margin:10px 10px">  
        <asp:Panel ID="Panel1" runat="server">  
        </asp:Panel>      
      
        <telerik:RadToolTipManager ID="RadToolTipManager1" OnAjaxUpdate="OnAjaxUpdate" runat="server" Skin="Web20Orange" animation="Fade">  
        </telerik:RadToolTipManager>        
        <radG:RadGrid ID="RadGridMembre" runat="server" EnableAJAX="true" Width="400" ShowHeader="true" ShowFooter="false" AutoGenerateColumns="false"   
                Skin="Orange" AllowSorting="false" AllowPaging="true" ShowGroupPanel="false" 
                OnItemDataBound="RadGrid1_ItemDataBound" OnNeedDataSource="RadGrid1_NeedDataSource1">  
            <ClientSettings AllowColumnsReorder="false" EnablePostBackOnRowClick="false">  
                <Selecting AllowRowSelect="false"/>  
            </ClientSettings> 
            <PagerStyle CssClass="RadGridPager" Mode="NextPrevAndNumeric"></PagerStyle> 
            <MasterTableView AutoGenerateColumns="False" PageSize="30">  
                <GroupByExpressions> 
                    <radG:GridGroupByExpression> 
                        <SelectFields> 
                            <radG:GridGroupByField FieldAlias="Pupitre" FieldName="Pupitre"></radG:GridGroupByField> 
                        </SelectFields> 
                        <GroupByFields> 
                            <radG:GridGroupByField FieldName="Pupitre" SortOrder="Ascending"></radG:GridGroupByField> 
                        </GroupByFields> 
                    </radG:GridGroupByExpression> 
                </GroupByExpressions>              
                <Columns> 
                    <radG:GridBoundColumn DataField="ID"  Display="false" ReadOnly="True" DataType="System.String" HeaderText="Nom d'usager" 
                        SortExpression="ID" UniqueName="ID">  
                        <HeaderStyle /> 
                    </radG:GridBoundColumn>                  
                    <radG:GridTemplateColumn HeaderText="" uniquename="Photo" Groupable="False">  
                        <ItemTemplate>                            
                            <asp:Image ID="Photo" BorderWidth="0px" 
                                ImageUrl='<%# DataBinder.Eval(Container.DataItem, "ID") %>' runat="server">  
                            </asp:Image> 
                        </ItemTemplate> 
                    </radG:GridTemplateColumn>         
                    <radG:GridBoundColumn DataField="NomComplet" DataType="System.string" HeaderText="Nom" UniqueName="NomComplet">  
                    </radG:GridBoundColumn>                                       
                    <radG:GridBoundColumn DataField="Depuis" DataType="System.string" HeaderText="Membre depuis" DataFormatString="{0:d}" UniqueName="Depuis">  
                    </radG:GridBoundColumn>                                                           
                </Columns> 
            </MasterTableView> 
        </radG:RadGrid>       

Another thing: When I add tha OnAjaxUpdate, the page crash when the mouse hover the + - icone of the grid group. If I remve this OnAjaxUpdate from the tooltipsmanager line, the toolip of the + radgrid appear correctly (displaying "Collapse group")

Thanks
Pierre
Marin Bratanov
Telerik team
 answered on 09 Nov 2011
1 answer
49 views
hi,

i have used RadCalender.net2 control in my project.

the scenario is <xxx:RadDatepicker .../>(here xxx is usercontrol tag prefix name) is used in aspx page, and in that same page i have used <telerik:Radtimepicker  .../> .nw the timepicker is not working.. but if use <xxx:Radtimepicker .../> in that page means its working but the style is not applying its simply displaying thats it... wat can i do..
Princy
Top achievements
Rank 2
 answered on 09 Nov 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?