databound

Disable separator selection in data bound combo box in WPF

风流意气都作罢 提交于 2019-12-06 07:41:59
I have a Combo Box that is databound. In this list, I need a separator. Since this is databound, I do something very similar to this post . My database returns the list, includes a '-' to mark where the separator needs to go, and the datatrigger makes this a separator. <ComboBox Name="cbAction" Grid.Column="1" Grid.Row="0" Margin="5,2,5,2" DisplayMemberPath="Description" SelectedValuePath="Code" SelectionChanged="cbAction_SelectionChanged"> <ComboBox.ItemContainerStyle> <Style TargetType="{x:Type ComboBoxItem}" BasedOn="{StaticResource {x:Type ComboBoxItem}}"> <Style.Triggers> <DataTrigger

How to programmatically insert a row in a GridView?

我是研究僧i 提交于 2019-12-03 19:11:00
问题 i have a databound GridView in asp.net 2.0 with a row-selection link. When a row is selected, I want to programmatically add a table row below the selected row, in order to nest another grid et al. I am researching this for a client and for an article, and i think my google-fu is not strong tonight. Any suggestions? EDIT: I actually had a working solution but Visual Studio was nutted up somehow; closing and re-opening VS and rebuilding everything fixed the problem ;-) My solution is posted

Programmatically Checking DataBound CheckListBox

孤街浪徒 提交于 2019-12-02 13:28:25
问题 I have a DataBound "CheckedListBox", I need to check some items on it. I tried with following code... if (!string.IsNullOrEmpty(search.Languages)) { string[] langs = search.Languages.Split(','); for (int i = 0; i < (langs.Length - 1); i++) { for (int j = 0; j < clbLang.Items.Count; j++) { string lng = clbLang.Items[j] as string; if (lng.Trim() == langs[i]) { clbLang.SetItemChecked(j, true); break; } } } } No errors, debuged execution is going through " checking " process, but finally I cannot

How to programmatically insert a row in a GridView?

↘锁芯ラ 提交于 2019-11-30 05:27:31
i have a databound GridView in asp.net 2.0 with a row-selection link. When a row is selected, I want to programmatically add a table row below the selected row, in order to nest another grid et al. I am researching this for a client and for an article, and i think my google-fu is not strong tonight. Any suggestions? EDIT: I actually had a working solution but Visual Studio was nutted up somehow; closing and re-opening VS and rebuilding everything fixed the problem ;-) My solution is posted below, please tell me how to make it better if possible. Thanks! I think I figured it out. Here is a

Data bound radio button list in WPF

旧时模样 提交于 2019-11-30 00:21:02
I have a list of options in a data object, and I want to make the equivalent of a radio button list to allow the user to select one and only one of them. Functionality similar to a databound combo box, but in radio button format. Silly me, I thought this would be built in, but no. How do you do it? Scott O. Basically, after reviewing the google results, I started with the info from an MSDN discussion thread where Dr. WPF provided an answer , which talks about styling a ListBox to look right. However, when the listbox is disabled, the background was an annoying color that I couldn't get rid of

How do I find the Client ID of control within an ASP.NET GridView?

北城以北 提交于 2019-11-27 14:40:29
I have a asp:GridView which contains a asp:TextBox within a TemplateField. I would like to obtain it's ID for use in javascript. Something like this: <asp:TemplateField> <ItemTemplate> <asp:TextBox ID="textDateSent" runat="server" /> <input type="button" value='Today' onclick="setToday('<%# textDateSent.ClientID %>');" /> </ItemTemplate> </asp:TemplateField> But when I compile, I get an error: The name 'textDateSent' does not exist in the current context Anybody know how to get the client ID of this TextBox? Try this: <asp:TemplateField> <ItemTemplate> <asp:TextBox ID="textDateSent" runat=

Data bound radio button list in WPF

霸气de小男生 提交于 2019-11-27 11:41:42
问题 I have a list of options in a data object, and I want to make the equivalent of a radio button list to allow the user to select one and only one of them. Functionality similar to a databound combo box, but in radio button format. Silly me, I thought this would be built in, but no. How do you do it? 回答1: Basically, after reviewing the google results, I started with the info from an MSDN discussion thread where Dr. WPF provided an answer, which talks about styling a ListBox to look right.

How do I find the Client ID of control within an ASP.NET GridView?

限于喜欢 提交于 2019-11-26 16:50:27
问题 I have a asp:GridView which contains a asp:TextBox within a TemplateField. I would like to obtain it's ID for use in javascript. Something like this: <asp:TemplateField> <ItemTemplate> <asp:TextBox ID="textDateSent" runat="server" /> <input type="button" value='Today' onclick="setToday('<%# textDateSent.ClientID %>');" /> </ItemTemplate> </asp:TemplateField> But when I compile, I get an error: The name 'textDateSent' does not exist in the current context Anybody know how to get the client ID