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

Radgrid with hyperlink column and Add new record functionality:-can not add hyperlink while adding record as no textbox appears to enter

4 Answers 42 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Automationmailcheck
Top achievements
Rank 1
Automationmailcheck asked on 23 Jun 2014, 01:30 PM
Radgrid with hyperlink column and Add new record functionality:-can not add hyperlink while adding record as no textbox appears to enter.

when i click on Add new record on radgrid textboxes and checkboxes appears for all
fields except Gridhyperlink column,
Could not get text box to enter link.
need solution except item template column.

4 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 1
answered on 24 Jun 2014, 06:31 AM
Hi,

I'm afraid the desired functionality of editing/inserting of GridHyperLinkColumn is not supported. You will have to use a GridTemplateColumn with TextBox in EditItemTemplate to achieve your requirement.

ASPX:
<telerik:GridTemplateColumn UniqueName="Country" HeaderText="Country">
    <ItemTemplate>
        <asp:HyperLink runat="server" ID="hlkCountry" NavigateUrl='<%# "http://www.google.com?q=" + Eval("Country") %>' Text='<%# Eval("Country") %>'>    
        </asp:HyperLink>
    </ItemTemplate>
    <EditItemTemplate>
        <asp:TextBox runat="server" ID="txtCountry" Text='<%# Bind("Country") %>'>  
        </asp:TextBox>
    </EditItemTemplate>
</telerik:GridTemplateColumn>

Thanks,
Shinu
0
Automationmailcheck
Top achievements
Rank 1
answered on 24 Jun 2014, 07:48 AM
<telerik:GridTemplateColumn DataField="jNm" HeaderText="Job" AllowFiltering="true"
                                    AutoPostBackOnFilter="true" UniqueName="jNm" HeaderStyle-Width="190px" DataType="System.String">
                                    <ItemTemplate>
                                        <a id="lnkjNm" href="JobsActivity.aspx?jobid=<%# Eval("jid")%>">
                                            <%# Eval("jNm")%>
                                        </a>
                                    </ItemTemplate>
                                    <InsertItemTemplate>
                                        <telerik:RadTextBox D="txtJobNmInsert" runat="server">
                                        </telerik:RadTextBox>
                                    </InsertItemTemplate>
                                    <EditItemTemplate>
                                        <asp:TextBox ID="txtJobNmEdit" ReadOnly="true" runat="server" Text='<%# Bind("jNm") %>'
                                            CssClass="textBox" />
                                    </EditItemTemplate>
                                    <HeaderStyle VerticalAlign="Middle" />
                                </telerik:GridTemplateColumn>

So this was have already tried but could not get text inserted in textbox at rgJobs_InsertCommand 
GridEditableItem editedItem = e.Item as GridEditableItem;
           Hashtable newValues = new Hashtable();
           e.Item.OwnerTableView.ExtractValuesFromItem(newValues, editedItem);

0
Automationmailcheck
Top achievements
Rank 1
answered on 24 Jun 2014, 09:03 AM
you can see i am getting only 5 items where i supposed to get 6 items
0
Shinu
Top achievements
Rank 1
answered on 25 Jun 2014, 04:21 AM
Hi,

Please try binding the value to the RadTextBox in InsertItemTemplate.

ASPX:
<InsertItemTemplate>
  <telerik:RadTextBox D="txtJobNmInsert" runat="server" Text='<%# Bind("jNm") %>'>
  </telerik:RadTextBox>
</InsertItemTemplate>

Thanks,
Shinu
Tags
Grid
Asked by
Automationmailcheck
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 1
Automationmailcheck
Top achievements
Rank 1
Share this question
or