Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
1.9K+ views
I have wired up an ItemDataBound handler for my radgrid.  Pretty simple standard fare (see code snippet below).  However, I've noticed while stepping through the debugger on this that when the column value that I'm retrieving is an empty string, I'm actually getting back " "... so my code never thinks it's an empty string...  I realize I could code something that looks for " " but that seems fragile.  

So I was wondering how I would access not the value from the radgrid column (which appears to be applying some formatting or whatever), but the actual, true blue underlying value from the data source. 

Any references on how to do so would be greatly appreciated.
 
protected void gvMain_ItemDataBound(object sender, GridItemEventArgs e)
   {
       if (e.Item is GridDataItem)
       {
           GridDataItem gridRow = (GridDataItem)e.Item;
           bool hasEamil = (gridRow["Email"].Text.Length > 0);
       }
   }
Eyup
Telerik team
 answered on 10 Apr 2012
5 answers
589 views
I have a couple fields that are notes fields that i do not put into my radgrid, but when I export I need to go and get them asn export them as well.  Is there a way to export the radgrids needdatasource?

<CommandItemTemplate>
                                      <table width="100%">
                                          <tr>
                                              <td align="right"><asp:Button ID="btnExport" runat="server" CommandName="ExportToExcel" Text="Export Excel" /></td>
                                          </tr>
                                      </table>
                                  </CommandItemTemplate>

Kevin
Top achievements
Rank 1
 answered on 10 Apr 2012
3 answers
182 views
When there are multiple column headers with the same name, the radgrid keeps adding a number to the end of the header. For example if I have repeating column headers that are aa, bb, cc, aa, bb, cc, aa, bb, cc the radgrid displayes them as aa, bb, cc, aa1, bb1, cc1, aa2, bb2, cc2 and so on. Is there a way to turn this off.
This is my code:
  <telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource3" Skin="Simple"
                CellSpacing="0" GridLines="None" Font-Size="8pt" CellPadding="0"  Wrap="False">
                <MasterTableView DataSourceID="SqlDataSource3" CommandItemDisplay="Top" Font-Size="8" CellPadding="0" Wrap="False">
                    <ItemStyle Wrap="False" />
                    <CommandItemTemplate>
                        <%=gridHeader%>
                    </CommandItemTemplate>
                    <CommandItemSettings ShowExportToWordButton="true" ShowExportToExcelButton="true"
                        ShowExportToCsvButton="true" />
                    <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column">
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column">
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </ExpandCollapseColumn>
                    <EditFormSettings>
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                        </EditColumn>
                    </EditFormSettings>
                </MasterTableView>
                <HeaderStyle Font-Size="8pt" Font-Underline="False" Wrap="False" />
                <FilterMenu EnableImageSprites="False">
                </FilterMenu>
                <HeaderContextMenu CssClass="GridContextMenu GridContextMenu_Default">
                </HeaderContextMenu>
            </telerik:RadGrid>



 Thanks in advance.
Eyup
Telerik team
 answered on 10 Apr 2012
2 answers
262 views
Hi, I'd like to ask help on how can I access (set / get control's value)  inside my RadPanelItem

Here's the scenario, I have this source code below.
OnClientClose(oWnd), gives me the arguments I need (Name and NameId).
However, I want to set the value back to LabelName and LabelNameId.

Pelase help.

Thanks!


<script type="text/javascript"> 
        //<![CDATA[
        function openWin()
        {
            var oWnd = radopen("../Common/SelectCompany.aspx?Typ=", "RadWindow1");
            //oWnd.setSize(340, 340);
            //set a function to be called when RadWindow is closed
            oWnd.add_close(OnClientClose);
        }
        function OnClientClose(oWnd) {
            //get the transferred arguments
            var Name = oWnd.argument.Name;
            var NameId = oWnd.argument.NameId;
            
            //????
            $get("LabelName").value = Name;
        }
        //]]> 
    </script> 
 
 
<telerik:RadPanelBar runat="server" ID="RadPanelBar1" Skin="Gray" Width="100%" Height="550px"> 
    <CollapseAnimation Type="None"></CollapseAnimation>     
    <Items> 
        <telerik:RadPanelItem Text="RadPanelItem7" Expanded="True" PreventCollapse="true"> 
            <Items> 
                <telerik:RadPanelItem runat="server" Value="RadPanelItem7"> 
                    <ItemTemplate> 
                        <table width="100%"> 
                            <tr> 
                                <td width="100px" class="style2">Name: </td> 
                                <td> 
                                    <asp:TextBox ID="TextBox1" runat="server" Width="100px"></asp:TextBox> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td class="style2">Long Name: </td> 
                                <td> 
                                    <asp:Label ID="LabelName" runat="server" Text="Please select..."></asp:Label> 
                                    <asp:imagebutton id="btnSearch" runat="server" CausesValidation="False" 
                                        ImageUrl="~/Images/find.gif" ToolTip="Search"></asp:imagebutton> 
                                    <button onclick="openWin(); return false;"> 
                                        Select</button> 
                                    <asp:Label ID="LabelNameId" runat="server"></asp:Label> 
                                </td> 
                            </tr> 
                            <tr> 
                                <td class="style2">Status: </td> 
                                <td><asp:DropDownList ID="ddlStatus" runat="server"></asp:DropDownList></td> 
                            </tr>     
                        </table> 
                        <br /> 
                    </ItemTemplate>           
                </telerik:RadPanelItem>               
            </Items> 
        </telerik:RadPanelItem> 
        <telerik:RadPanelItem Text="RadPanelItem9" Expanded="True"> 
            <Items> 
                <telerik:RadPanelItem runat="server" Value="RadPanelItem9"> 
                    <ItemTemplate>     
                    List...               
                    <br /><br /> 
                    </ItemTemplate>           
                </telerik:RadPanelItem>               
            </Items> 
        </telerik:RadPanelItem> 
        <telerik:RadPanelItem Text="RadPanelItem8" Expanded="True"> 
            <Items> 
                <telerik:RadPanelItem runat="server" Value="RadPanelItem8"> 
                    <ItemTemplate>  
                    List...                                          
                    <br /><br /> 
                    </ItemTemplate>           
                </telerik:RadPanelItem>               
            </Items> 
        </telerik:RadPanelItem> 
    </Items> 
    <ExpandAnimation Type="None"></ExpandAnimation> 
</telerik:RadPanelBar> 
</div> 
<telerik:RadWindowManager Modal="true"  
    Behaviors="Maximize,Minimize,Move,Pin,Reload,Resize,Close"  
        ID="RadWindowManager1" ShowContentDuringLoad="true" runat="server"   
        VisibleStatusbar="false" 
         Width="400px" Height="400px" 
        Skin="Default"> 
</telerik:RadWindowManager> 



christian
Top achievements
Rank 1
 answered on 10 Apr 2012
5 answers
218 views
Hi,
Iam using rad control inside modal popup in asp.net 3.5, and getting following Error. So please tell me why iam getting this error.
Microsoft JScript runtime error: Sys.InvalidOperationException: Two components with the same id 'ctl00_ContentPlaceHolder1_RadCalendar1' can't be added to the application.
Antonio
Top achievements
Rank 1
 answered on 10 Apr 2012
1 answer
163 views
Hello,

How to display context menu at left mouse click of gridbutton. Context menu is displayed on right mouse click at grid button but i want to display it at left mouse click.

Thanks in advance.
Sigma
Princy
Top achievements
Rank 2
 answered on 10 Apr 2012
1 answer
270 views
I have the timeline view configured to show a multi-column table in the resource area.  I have the header and the content lining up, but I would like to have a horizontal scroll bar show up.  You provide horizontal scrolling in the appointment area and it includes the content and the header.  I assume you have an event associated with the horizontal scrollbar to move the header along with the content.

Do you have any plans to provide more flexibility in the appearance of the resource area?

Peter
Plamen
Telerik team
 answered on 10 Apr 2012
2 answers
184 views
<CommandItemTemplate>                                               
    <div style="width:100%; height:100%;">
        <asp:LinkButton ID="btnAddDropShipSubjectArea" runat="server" CommandArgument="SubjectArea" CommandName="InitInsert">
<
img style="border:0px" alt="" src="../CSS/View/Grid/AddRecord_ToolTip.gif" /> Add Subject Area
        </asp:LinkButton>
        <asp:LinkButton ID="btnAddDropShipItem" runat="server" CommandArgument="Item" CommandName="InitInsert">
<
img style="border:0px" alt="" src="../CSS/View/Grid/AddRecord_ToolTip.gif" /> Add Item
        </asp:LinkButton>
    </div>
</CommandItemTemplate>  
<Columns>
    <telerik:GridDropDownColumn Visible="false" UniqueName="ddlSubjectAreaCodes" DataField="IntAreaCode_SK"
        HeaderText="ID" DropDownControlType="RadComboBox" AutoPostBackOnFilter="true">
    </telerik:GridDropDownColumn>
</Columns> 

I have a grid with the markup above. I have two link buttons that do two different things; I couldn't find
out how to populate ddlSubjectAreaCodes with different data based on the link clicked in the ItemCreated
event.
Any help is appreciated.
Thanks
fahd
Top achievements
Rank 1
 answered on 10 Apr 2012
3 answers
180 views
Is there a way to disable a sliding panel's tab from the server side? The "enabled" attribute on the RadSlidingPane does not seem to do the trick.
Dobromir
Telerik team
 answered on 10 Apr 2012
1 answer
199 views
Hi,
I have a grid with a GridTemplateColumn checkbox. And a button.
When my button fires I loop all MasterTableView Items and find out which ones are checked.

For every checked row I do perform a delete (server side).
Before it I would like to open a radwindow to do some other stuff

it look like this

     For Each item As GridDataItem In RadGridNM.MasterTableView.Items
                Dim myChk As CheckBox = CType(item.FindControl("CheckBoxSet"), CheckBox)
                If myChk.Checked Then                            
                    RadAjaxManager1.ResponseScripts.Add(String.Format("OpenNews(" & valQuestion & ");"))

            '----------------------------
            'here perform delete    
           
                End If

   Next


My goal is to wait until radwindow is closed to perform the delete operation, clearly it does not happen and the loop goes on.
I know that the problem is they works in two different level client-side and server-side.
How do i achieve my goal? someone can help me?
Thank you.
Kevin
Top achievements
Rank 2
 answered on 10 Apr 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?