I have a GridView which displays hundreds of rows of data. It is very important that I control the height of each row to minimize wasted space. In other words, I want to remove as much white space above and below the text being displayed. This was working
fine until I added a RadioButtonList (with RepeatDirection="Horizontal") to my GridView.
Even with Height="8px" the rows' minimum height appears to be around 16px. Is there a way to control the size of the radiobutton image so that I can make it smaller?
Setting the Height of the RadioButton to anything less than 16px does not have any affect on the height of the image and the height of the row. Because each radiobutton image appears to be 16px square the minimum height and width appears to be 16px and,
therefore, the minimum height of the row is 16px.
Is there a method of substituting the standard radiobutton image with another smaller image?
Haven't tried it, but you could see if this page works: http://ryanfait.com/resources/custom-checkboxes-and-radio-buttons/
Superguppie.
Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread.
When all you've got is a Hammer, Every Problem looks like a Nail. Michael Swain.
HardingR
Member
55 Points
42 Posts
Can the Size of the RadioButton Image Be Controlled
Feb 24, 2012 05:12 PM|LINK
I have a GridView which displays hundreds of rows of data. It is very important that I control the height of each row to minimize wasted space. In other words, I want to remove as much white space above and below the text being displayed. This was working fine until I added a RadioButtonList (with RepeatDirection="Horizontal") to my GridView.
<asp:RadioButtonList ID="optProtest" runat="server" AutoPostBack="true" Height="8px" OnSelectedIndexChanged="dg_VPAHI_SelectedIndexChanged" RepeatDirection="Horizontal"> <asp:ListItem Text="" Value="M"></asp:ListItem> <asp:ListItem Text="" Value="U"></asp:ListItem> <asp:ListItem Text="" Value="B"></asp:ListItem> </asp:RadioButtonList>Even with Height="8px" the rows' minimum height appears to be around 16px. Is there a way to control the size of the radiobutton image so that I can make it smaller?
radiobuttonlist asp.net
basheerkal
Star
10672 Points
2426 Posts
Re: Can the Size of the RadioButton Image Be Controlled
Feb 24, 2012 06:26 PM|LINK
Of course, there are Height and Width properties to set..But if the height is less than 16px it will not be visible fully.
B
(Talk less..Work more)
HardingR
Member
55 Points
42 Posts
Re: Can the Size of the RadioButton Image Be Controlled
Feb 24, 2012 06:35 PM|LINK
Setting the Height of the RadioButton to anything less than 16px does not have any affect on the height of the image and the height of the row. Because each radiobutton image appears to be 16px square the minimum height and width appears to be 16px and, therefore, the minimum height of the row is 16px.
Is there a method of substituting the standard radiobutton image with another smaller image?
superguppie
All-Star
48225 Points
8679 Posts
Re: Can the Size of the RadioButton Image Be Controlled
Feb 27, 2012 02:17 PM|LINK
Haven't tried it, but you could see if this page works: http://ryanfait.com/resources/custom-checkboxes-and-radio-buttons/
Please remember to click “Mark as Answer” on the post that helps you. This can be beneficial to other community members reading the thread.
When all you've got is a Hammer, Every Problem looks like a Nail. Michael Swain.