I have an <asp:ComboBox>
filled with <asp:CheckBoxes>
. The Combobox is 200px wide. The Checkboxes are also 200px wide.
I can check the checkbox only if I click on 'box' or the checkbox text label. I want to be able to check the item even when I click anywhere on the row.
Is there any way to extend this area to the whole row?
update:
On the green area, everything is fine. But on the red area when i click, checkbox is not checked and drop downlist goes up.
<telerik:RadComboBox runat="server" EnableTextSelection="false"
ID="rcb_Something"
Width="200px"
Hig开发者_如何转开发hlightTemplatedItems="true"
AllowCustomText="true"
Text="Select Something"
MaxHeight="250px">
<ItemTemplate>
<telerik:RadBinaryImage ID="RadBinaryImage1" runat="server"
Width="24px"
Height="24px"
DataValue='<%# Eval("Something") %>'
ResizeMode="Fit" />
<asp:CheckBox ID="CheckBox1"
runat="server"
Text='<%# Eval("Something") %>'
ToolTip='<%# Eval("SomethingId") %>'
/>
</ItemTemplate>
Do as books say - add to every input field in HTML, a label tag with label.
<label for="male">Male</label> <input type="radio" name="sex" id="male" />
Clicking anywhere on label, will activate this input, same goes for input type=text
Ok, I find solution. I just disabled combobox background with following code.
JavaScript
function StopPropagation(e) { //cancel bubbling e.cancelBubble = true; if (e.stopPropagation) { e.stopPropagation(); } }
aspx
<div onclick="StopPropagation(event)">
<asp:CheckBox ID="CheckBox1"
runat="server"
Text='<%# Eval("something") %>'
ToolTip='<%# Eval("somethingId") %>'
/>
</div>
精彩评论