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

Display Textbox in Middle of the Row

5 Answers 84 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Atchut
Top achievements
Rank 1
Atchut asked on 08 Jun 2012, 05:19 PM
Hello,

I have a column with two textboxes with BREAK. I need those breaks. Here is my HTML. Depending on the codition, I may or may not display the second textbox. If I am not displaying second textbox, how can I make the first textbox in the middle of the row.

<telerik:GridTemplateColumn HeaderText="Exception Price" UniqueName="ExceptionPrice" ItemStyle-Width="8%">
                   <ItemTemplate>
                     <telerik:RadNumericTextBox  ID="txtNewPrice" runat="server" MaxLength="10" AutoCompleteType="None" CssClass="txtException" MinValue="0"
                                Width="50px"     Type="Number" ShowSpinButtons="false" AllowOutOfRangeAutoCorrect="false" InvalidStyle-Font-Bold="true">
                                    <NumberFormat  AllowRounding="false" DecimalDigits="2"  KeepNotRoundedValue="true" GroupSizes="3"/>
                                    <ClientEvents OnValueChanging="ValueChanges" OnError="HandleError"/>
                                </telerik:RadNumericTextBox>
                                <br /><br />
                   <div style="vertical-align:bottom" >
                   <telerik:RadNumericTextBox  ID="TxtNewPSPrice" runat="server" MaxLength="10" AutoCompleteType="None"  MinValue="0"  Visible="false"
                          Width="50px" Type="Number" ShowSpinButtons="false" AllowOutOfRangeAutoCorrect="false" InvalidStyle-Font-Bold="true" CssClass="txtException">
                       <NumberFormat AllowRounding="false" DecimalDigits="2"  KeepNotRoundedValue="true" GroupSizes="3"/>
                         <ClientEvents OnValueChanging="ReinstatementChange" OnError="HandleError"/>
                      </telerik:RadNumericTextBox>
                    </div>
                                
                    </ItemTemplate>
               </telerik:GridTemplateColumn>

5 Answers, 1 is accepted

Sort by
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 08 Jun 2012, 05:42 PM
Hello,

Please check below code snippet.
</ItemTemplate>
                        <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                    </telerik:GridTemplateColumn>


Thanks,
Jayesh Goyani
0
Atchut
Top achievements
Rank 1
answered on 08 Jun 2012, 06:07 PM
It is still displaying on the top because of the two <br/>
0
Accepted
Jayesh Goyani
Top achievements
Rank 2
answered on 08 Jun 2012, 06:13 PM
Hello,

<ItemTemplate>
                           <telerik:RadNumericTextBox ID="txtNewPrice" runat="server" MaxLength="10" AutoCompleteType="None"
                               CssClass="txtException" MinValue="0" Width="50px" Type="Number" ShowSpinButtons="false"
                               AllowOutOfRangeAutoCorrect="false" InvalidStyle-Font-Bold="true">
                               <NumberFormat AllowRounding="false" DecimalDigits="2" KeepNotRoundedValue="true"
                                   GroupSizes="3" />
                           </telerik:RadNumericTextBox>
                           <div id="" runat="server" visible="false">
                               <br />
                               <br />
                               <telerik:RadNumericTextBox ID="TxtNewPSPrice" runat="server" MaxLength="10" AutoCompleteType="None"
                                   MinValue="0"  Width="50px" Type="Number" ShowSpinButtons="false"
                                   AllowOutOfRangeAutoCorrect="false" InvalidStyle-Font-Bold="true" CssClass="txtException">
                                   <NumberFormat AllowRounding="false" DecimalDigits="2" KeepNotRoundedValue="true"
                                       GroupSizes="3" />
                               </telerik:RadNumericTextBox>
                           </div>
                       </ItemTemplate>


Thanks,
Jayesh Goyani
0
Atchut
Top achievements
Rank 1
answered on 08 Jun 2012, 06:49 PM
Hello Jayesh,

It works great. Only issue is, If I make Div tag invisible. how can I make that visible in code behind.
0
Jayesh Goyani
Top achievements
Rank 2
answered on 08 Jun 2012, 06:57 PM
Hello,

<div id="myDiv" runat="server">
                           jayesh
                       </div>
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
        {
            if (e.Item is GridDataItem)
            {
                GridDataItem item = e.Item as GridDataItem;
                (item.FindControl("myDiv") as System.Web.UI.HtmlControls.HtmlGenericControl).Visible = false;
            }
}


Thanks,
Jayesh Goyani
Tags
Grid
Asked by
Atchut
Top achievements
Rank 1
Answers by
Jayesh Goyani
Top achievements
Rank 2
Atchut
Top achievements
Rank 1
Share this question
or