Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
81 views
Hello 
I've a radgridview with a datasource.

For a certain column I need to call a function which return a string, here's what I do (simplified)

<telerik:GridTemplateColumn>
                            <ItemTemplate>
                                <%# Functions.GetTheString(Eval("ID")) %>
                            </ItemTemplate>
                            <EditItemTemplate>
                                    <telerik:RadTextBox id="editString"   Text='Functions.GetTheString(Eval("ID")) ' ></telerik:RadTextBox>
                            </EditItemTemplate>
  </telerik:GridTemplateColumn>

It works fine for the edit but I m not able to do an insert anymore... Chrome console says It can't convert the dbnull into integer... How can I get an empty text box for an insert and calling my function for an edit?

Thanx in advance
Jayesh Goyani
Top achievements
Rank 2
 answered on 31 Mar 2012
3 answers
223 views
Hello,

I have a raddate control in a radajaxpanel. I would like the raddate postback=true but I do not wish to have two ajax loading animations during postback. I would like to disable the raddate control loading panel and let the ajaxpanel display the loading animation. It seems simple but I can't seem to figure it out and the terms I'm using on Google don't provide any clues.

TIA
JB

Oh Yeah version 2012.1.301.40
I suppose some code just in case it isn't clear:
<td style="width:300px;height:500px;"> <!--This cell holds the invoice date selection control-->
     <telerik:RadAjaxPanel ID="ajxpnl_InvDate" runat="server" LoadingPanelID="InvDateLoadPanel">
          Invoice Date <telerik:RadDatePicker ID="rdt_InvDate" runat="server" Skin="Hay" AutoPostBack="true" ShowPopupOnFocus="true" OnSelectedDateChanged="selected" />
    </telerik:RadAjaxPanel>
</td>

SamJ
Top achievements
Rank 1
 answered on 31 Mar 2012
1 answer
161 views
Hi,


please give idea, i need it now..

"how to get the inner detailtable[1] controls in itemDatabound or itemCommand event? ..while clicking the row i need to rebind the columns of second detailtable column based of its another column value?" ques

Am using telerik:RadGrid control for displaying my data's, the grid is in hierarchy mode, in this grid three table values are binding...

the grid structure is mastertableview[] +
Detailtableview[0] +
Detailtableview[1]                                                                                                                                                                                                                                                                

below is my coding in aspx page,


<telerik:RadGrid ID="rgAdminLogIn" runat="server" Width="100%" ShowStatusBar="true" AllowFilteringByColumn="true" 
                                AutoGenerateColumns="False" PageSize="500" AllowSorting="True" AllowMultiRowSelection="False"
                                AllowPaging="True" OnDetailTableDataBind="rgAdminLogIn_DetailTableDataBind" OnNeedDataSource="rgAdminLogIn_NeedDataSource" OnItemCommand="rgAdminLogIn_ItemCommand" OnItemCreated="rgAdminLogIn_ItemCreated"
                                GridLines="None" OnItemDataBound="rgAdminLogIn_ItemDataBound">
                                <PagerStyle Mode="NextPrevAndNumeric"></PagerStyle>

                                <MasterTableView HierarchyLoadMode="ServerOnDemand" Width="100%" DataKeyNames="LoginId" AllowFilteringByColumn="true" CommandItemDisplay="Top"
                                    AllowMultiColumnSorting="True" ShowHeader="true" GridLines="None">
                                    <DetailTables>
                                       
 <telerik:GridTableView HierarchyLoadMode="ServerOnDemand" DataKeyNames="LoginId,AccountTypeId" AllowFilteringByColumn="false"
                                            Name="AccountType" Width="100%" ShowHeader="false" GridLines="None" BorderStyle="None" HierarchyDefaultExpanded="true" >
                                            <DetailTables>

                                                <telerik:GridTableView HierarchyLoadMode="ServerOnDemand" Name="Account" Width="100%" DataKeyNames="Id" AllowFilteringByColumn="false" 
                                                    ShowHeader="true" GridLines="None" BorderStyle="None">
                                                    <Columns>
                                                    <telerik:GridTemplateColumn HeaderText="Delete" ItemStyle-HorizontalAlign="Center"
                                                            HeaderStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle" HeaderStyle-Width="70px">
                                                            <ItemTemplate>
                                                                <asp:ImageButton ID="lnkDelete" runat="server" OnCommand="lnkDelete_OnDelete" CommandArgument='<%# Eval("Id") + "," + Eval("Type") %>'
                                                                    OnClientClick="Are you sure to delete this account?" ToolTip="click here to delete this account"
                                                                    ImageUrl="~/ImagesNew/delete-icon.png" />
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridBoundColumn SortExpression="CreatedOn" DataField="CreatedOn" HeaderText="CreatedOn"
                                                            ItemStyle-Width="70px">
                                                        </telerik:GridBoundColumn> 
                                                        <telerik:GridBoundColumn SortExpression="IsActivated" UniqueName="IsActivated" DataField="IsActivated" HeaderText="IsActivated"
                                                            ItemStyle-Width="70px" Visible="false">
                                                        </telerik:GridBoundColumn>                                                      
                                                        <telerik:GridBoundColumn SortExpression="Name" DataField="Name" HeaderText="Name"
                                                            ItemStyle-Width="100px">
                                                        </telerik:GridBoundColumn>                                                        
                                                        <telerik:GridTemplateColumn UniqueName="OrganizationName" HeaderText="Hospital Name"
                                                            DataField="OrganizationName" ItemStyle-HorizontalAlign="Left" ItemStyle-VerticalAlign="Top" 
                                                            HeaderStyle-Width="150px">
                                                            <ItemTemplate>
                                                                <asp:HyperLink ID="hlnkOrganizationName" NavigateUrl='<%# "http://" + Eval("SubDomain") + "." + GetRootDomain() %>'
                                                                    runat="server" Target="_blank" ToolTip="Click here to view Landing Page"><%# Eval("OrganizationName") %></asp:HyperLink>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>  
                                                        <telerik:GridTemplateColumn HeaderText="Admin Activation" ItemStyle-HorizontalAlign="Center"
                                                            UniqueName="Activation" HeaderStyle-HorizontalAlign="Center" ItemStyle-VerticalAlign="Middle"
                                                            HeaderStyle-Width="70px">
                                                            <ItemTemplate>
                                                                <asp:LinkButton ID="lnkActivation" runat="server" Text='<%#Eval("IsActivated") %>'
                                                                    OnCommand="lnkActivation_OnUpdate" CommandArgument='<%# Eval("Id") + "," + Eval("Type") %>' />
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>
                                                        <telerik:GridTemplateColumn HeaderText="Auto Login" ItemStyle-HorizontalAlign="Center"
                                                            ItemStyle-VerticalAlign="Middle" HeaderStyle-Width="50px">
                                                            <ItemTemplate>
                                                                <asp:HyperLink ID="hlnkLogin" NavigateUrl='<%# GetUrl() + "Default.aspx?user=" + Eval("EmailId") + "&type=" + Eval("Type") + "&orgid=" + Eval("OrganizationId") + "&accountid=" + Eval("Id") %>'
                                                                    Text="Login" runat="server" Target="_blank" ToolTip="Click here to auto login" />
                                                                    <asp:Label ID="lblActivate" runat="server" Text='<%#Eval("IsActivated") %>' Visible="false"></asp:Label>
                                                            </ItemTemplate>
                                                        </telerik:GridTemplateColumn>                                                        
                                                        <telerik:GridBoundColumn SortExpression="SubDomain" DataField="SubDomain" HeaderText="SubDomain" Visible="false">
                                                        </telerik:GridBoundColumn>
                                                        <telerik:GridBoundColumn SortExpression="OrganizationId" DataField="OrganizationId" HeaderText="OrganizationId" Visible="false">
                                                        </telerik:GridBoundColumn>
                                                    </Columns>
                                                    <NoRecordsTemplate>
                                                        <span style="color: red; font-size: 8pt;"><i>There is no account in this account type!</i></span>
                                                    </NoRecordsTemplate>
                                                </telerik:GridTableView>
                                            </DetailTables>
                                            <Columns>
                                                <telerik:GridBoundColumn SortExpression="AccountTypeName" DataField="AccountTypeName" ItemStyle-Width="150px">
                                                </telerik:GridBoundColumn>
                                            </Columns>
                                        </telerik:GridTableView>
                                    </DetailTables>

                                    <Columns>
                                    <telerik:GridBoundColumn SortExpression="IsActivated" UniqueName="IsActivated" DataField="IsActivated" HeaderText="IsActivated"
                                                            ItemStyle-Width="70px" Visible="false">
                                                        </telerik:GridBoundColumn>  
                                        <telerik:GridBoundColumn SortExpression="EmailId" DataField="EmailId" HeaderText="Email Id" AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith"
                                            ItemStyle-Font-Bold="true">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="MobileId" DataField="MobileId" HeaderText="Mobile Number" AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith"
                                            ItemStyle-Font-Bold="true">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="Password" DataField="Password" HeaderText="Password"  AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith"
                                            ItemStyle-Font-Bold="true">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="ActivationStatus" UniqueName="ActivationStatus" DataField="ActivationStatus" HeaderText="Main Account Status" AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith"
                                            ItemStyle-Font-Bold="true">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridBoundColumn SortExpression="Profile" DataField="Profile" HeaderText="Profile Status" AutoPostBackOnFilter="true" CurrentFilterFunction="StartsWith"
                                            ItemStyle-Font-Bold="true">
                                        </telerik:GridBoundColumn>
                                        <telerik:GridTemplateColumn HeaderText="Auto Login" ItemStyle-HorizontalAlign="Center"
                                            ItemStyle-VerticalAlign="Middle" HeaderStyle-Width="50px">
                                            <ItemTemplate>
                                                <asp:HyperLink ID="hlnkLogin" NavigateUrl='<%# GetUrl() + "Default.aspx?user=" + Eval("EmailId").ToString().Trim() + "&type=5&orgid=0&accountid=" + Eval("LoginId") %>'
                                                    Text="Login" runat="server" Target="_blank" ToolTip="Click here to auto login" />
                                            </ItemTemplate>
                                        </telerik:GridTemplateColumn>
                                    </Columns>
                                    <NoRecordsTemplate>
                                        <span style="color: red; font-size: 8pt;"><i>No Login account available.</i></span>
                                    </NoRecordsTemplate>
                                </MasterTableView>
                            </telerik:RadGrid>



here i need to display the inner detailtable[1] column "autologin" based on the "isactivated" column...

now i have tried by the below way but its showing error.....


protected void rgAdminLogIn_ItemCommand(object source, GridCommandEventArgs e)

    {       
        if (e.CommandName == "ExpandCollapse")
        {
            GridNestedViewItem item = (GridNestedViewItem)e.Item;
            HyperLink hlnkAutoLogin = (HyperLink)item.FindControl("hlnkLogin");
            Label lblActivate = (Label)item.FindControl("lblActivate");
           if (lblActivate.Text == "Activate")
            {
                hlnkAutoLogin.Enabled = true;
            }
            else
            {
               hlnkAutoLogin.Enabled = false;
           }
        }
    }


so my ques is.....

how to get the inner detailtable controls in itemDatabound or itemCommand event?..

 
Jayesh Goyani
Top achievements
Rank 2
 answered on 31 Mar 2012
3 answers
207 views
When I launch spell checker from RAD Editor on my development PC it works fine, but on my web server I get a 500 error with the following message in a dialog box:

Telerik.Web.UI.SpellCheckHandler.axd

 

Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.

I am not using a custom dictionary, only the standard ones.

Larry
Top achievements
Rank 1
 answered on 31 Mar 2012
8 answers
336 views
Hi

I'm trying to fix some bug with my radgrid. I have some GridBoundColumn followed by one GridTemplateColumn with a regular Button in it. The button triggers a JavaScript function which shows a RadWindow as a popup.

My problem is when I click on the button, the RadWindow popup but also a big blank space appear in the RadGrid at top, above the header. The size of this space is about the same as the actual size of the rows shown under it.

This is most likely related to the fact that I want the grid to show an vertical scroll bar.

Anyway here is some code:

<telerik:RadGrid ID="RG_disponible" AlternatingItemStyle-HorizontalAlign="Center" 
                                        Width="550px" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" 
                                        runat="server" AllowSorting="true" HorizontalAlign="Center" AutoGenerateColumns="False" 
                                        OnItemDataBound="RG_disponible_ItemDataBound" OnSortCommand="RG_disponible_SortCommand" 
                                        OnItemCommand="RG_disponible_ItemCommand" OnDataBound="RG_disponible_DataBound"
                                        <ClientSettings> 
                                            <Resizing AllowColumnResize="false" /> 
                                            <Scrolling AllowScroll="true" UseStaticHeaders="false" /> 
                                        </ClientSettings> 
                                        <MasterTableView CommandItemDisplay="Top" TableLayout="Fixed" Width="532px" NoMasterRecordsText="Aucune photo ne correspond Ã  la recherche"
                                            <CommandItemTemplate> 
                                                <div style="text-align: right;"
                                                    <asp:LinkButton ID="btnSelectAll" runat="server" CommandName="SelectAll" Text="Désélectionner tous"></asp:LinkButton> 
                                                </div> 
                                            </CommandItemTemplate> 
                                            <Columns> 
                                                <telerik:GridBoundColumn HeaderText="Numéro du rouleau" UniqueName="Numero_rouleau" 
                                                    DataField="RouleauNumero"
                                                </telerik:GridBoundColumn> 
                                                <telerik:GridBoundColumn HeaderText="Numéro de la photo" UniqueName="Numero" DataField="PhotoNumero"
                                                </telerik:GridBoundColumn> 
                                                <telerik:GridTemplateColumn UniqueName="ButtonColumn" HeaderText=""
                                                    <ItemTemplate> 
                                                        <asp:Button ID="I" runat="server" Text="Détails"/> 
                                                    </ItemTemplate> 
                                                </telerik:GridTemplateColumn> 
                                                <telerik:GridBoundColumn HeaderText="Numéro de la photo" UniqueName="Numero" Visible="false" 
                                                    DataField="PhotoNumero"
                                                </telerik:GridBoundColumn> 
                                                <telerik:GridBoundColumn HeaderText="id photo" Visible="false" UniqueName="Id" DataField="Id"
                                                </telerik:GridBoundColumn> 
                                                <telerik:GridTemplateColumn UniqueName="TemplateColumn" HeaderText="" SortExpression="IsLink"
                                                    <ItemTemplate> 
                                                        <asp:CheckBox ID="choix" Enabled="false" runat="server" /> 
                                                    </ItemTemplate> 
                                                </telerik:GridTemplateColumn> 
                                                <telerik:GridBoundColumn HeaderText="" UniqueName="Id" DataField="EmprunteurId" Visible="false"
                                                </telerik:GridBoundColumn> 
                                                <telerik:GridBoundColumn HeaderText="" UniqueName="CommandeId" DataField="CommandeId" 
                                                    Visible="false"
                                                </telerik:GridBoundColumn> 
                                            </Columns> 
                                        </MasterTableView> 
                                    </telerik:RadGrid> 
                                </ContentTemplate> 
                            </asp:UpdatePanel> 

As you can see, the reason why I kinda really need scrolling to work is because I can't use paging because of the CheckBox column. I don't see how i could get to save the rows which were checked after the page is changed. So when a button under the radgrid is clicked, I can access the RadGrid and retrieve the rows that are checked. If someone can tell me a way to do this, then I might as well drop the scrolling for paging and avoid the blank space issue.

This is what i have on the button with ID="I" which cause the problem. I do this in the itemdatabound event:

Button btn = dataItem["ButtonColumn"].FindControl("I") as Button;

btn.Attributes["onclick"] = string.Format("return ShowEditForm('{0}?{1}={2}','rwEmprunteurView');",
                "emprunteur_view.aspx", "commande_id", dataItem.Cells[11].Text);

btn.Attributes["onclick"] = string.Format("return ShowEditForm('{0}?{1}={2}','rwEmprunteurView');",
                "emprunteur_view.aspx", "commande_id", dataItem.Cells[11].Text);


With ShowEditForm being:
        function ShowEditForm(url, nomFenetre) {
            window.radopen(url, nomFenetre);
            return false;
        }

This is on IE 6. I tried in Firefox, and I dont get the white space.. But I need it to work on IE 6.

If you need more of my code, just ask.

Thanks










Anthony
Top achievements
Rank 1
 answered on 30 Mar 2012
4 answers
275 views
Does telerik have a textbox control that I can tie to a database table that will do the autocomplete based on what the users starts typing?

Thank you
jerry
Top achievements
Rank 1
 answered on 30 Mar 2012
6 answers
311 views
Hi,
i use rad ajax panel in my page. in that page i got four buttons.
when clicking that buttons one button event is triggered. another 3 dosent work.
how to solve it.
SamJ
Top achievements
Rank 1
 answered on 30 Mar 2012
1 answer
173 views
IsPostBack always true in user control.

How to fix this?

I need to add some code to load the data.

Need help ASAP?
Eva
Top achievements
Rank 1
 answered on 30 Mar 2012
1 answer
127 views
Hi,

I have been incorporating a radgrid into an ascx control which is designed to be used in DNN. The issue comes when I create the same grid in an aspx page while setting the PopUpSettings-Modal="true" it works perfectly that the edit popu comes up prperly while freezing the rest of the screen.

However when i use the same grid in an ascx page when the edit popup comes it freezes the whole screen including the popup as well?

Can any body help me with this?

Regards,
Savi
Pavlina
Telerik team
 answered on 30 Mar 2012
1 answer
62 views
The progress bar i cannot get to work the way i want it too. So other than that is there a way i can let a user know that the file is uploading.  Like is there a way to make the refresh spinny thing spin as long as the file is uploading?
Dobromir
Telerik team
 answered on 30 Mar 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
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?