All my details tables are expanded by default. I'd like to set the background color of every detail row to match the background color of its respective parent row. I assume it would be something along these lines:
Sub RadGrid1_ItemCreated(...)
if itemcreated is a detail row
determine if parent row is item or alternatingitem
set detail row's background style to match item/alternating style
end if
End Sub
Is this possible? If so, could you please provide a sample code?
Thanks!
I am creating and populating some comboboxes in code for a page using 2008 SP1.
Everything seems to work fine except that it will automatically set the selected item to the first item in the list (selectedindex = 0)
If I set the selectedindex to -1 it will revert to 0. Adding an empty item to the combobox will then show the empty text but it seems a bit clunky.
Is this behaviour of automatically selecting the first combobox item (and therefore not showing the emptymessage either) correct?
code extract below :-
RadComboBox cmb = new RadComboBox();
//Set the ID
cmb.ID = "cmb_" + row.MyID;
cmb.SelectedIndex = -1;
//Add the control to the listitem container
item.Controls.Add(cmb);
//Get the possible values
string[] values = Value.Split('|');
//Custom or fixed list?
cmb.AllowCustomText = Custom;
if (Custom)
cmb.EmptyMessage = "Select a value or enter your own";
else
cmb.EmptyMessage = "Select a value";
//Will show empty message if I add a blank item to the combo first
//RadComboBoxItem emptyItem = new RadComboBoxItem(String.Empty);
//cmb.Items.Add(emptyItem);
//emptyItem.Selected = true;
foreach (string value in values)
{
RadComboBoxItem cmbItem = new RadComboBoxItem(value);
if (cmbItem.Text == row.Value)
cmbItem.Selected = true;
cmb.Items.Add(cmbItem);
}
//If no item matched and cmbItem.Selected = true is not hit, it will still
//have selectedindex = 0 and show the first item, not the empty message
<radI:RadNumericTextBox EnabledStyle-Font-Names="verdana" EnabledStyle-Font-Size="Small" BorderWidth="0" ReadOnly="true" ID="txtHedge" NegativeStyle-ForeColor="red" EnabledStyle-HorizontalAlign="Right" runat="server" MaxLength="18">
<EnabledStyle HorizontalAlign="Right" />
<NegativeStyle ForeColor="Red" />
</radI:RadNumericTextBox>
| function ValidateRadUpload1(source, arguments) | |
| { | |
| arguments.IsValid = getRadUpload('<%= RadUpload1.ClientID %>').validateExtensions(); | |
| } | |
| function realPostBack(eventTarget, eventArgument) | |
| { | |
| $find("<%= RadAjaxPanel1.ClientID %>").__doPostback(eventTarget, eventArgument); | |
| } | |
| function CloseAndRebind(args) | |
| { | |
| GetRadWindow().Close(); | |
| GetRadWind().BrowserWindow.refreshGridP(args); | |
| } | |
| function GetRadWindow() | |
| { | |
| var oWindow = null; | |
| if(window.radWindow) | |
| oWindow = window.radWindow; //Will work in Moz in all cases, includine classic dialog | |
| else if(window.frameElement.radWindow) | |
| oWindow = window.frameElement.radWindow; //IE (and Moz as well | |
| return oWindow; | |
| } | |
| function CancelEdit() | |
| { | |
| GetRadWindow().Close(); | |
| } |