Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
656 views
Hello,

I've implemented a requiredfieldvalidator for a radcombobox which works fine on submitting the form, however I would like to show the red asterisk before the page is submitted to indicate to the user that the field is required.  Using

Page.Validate();

in the Page_load event on the server activates the required field validators that are defined against text boxes, but I can't get the validator associated  with the combobox to show.

 
      <table>
        <tr>
            <td><telerik:RadComboBox id="ddlCostCategory" DataTextField="Name" DataValueField="ID" runat="server" SkinID="WideDll"  ></telerik:RadComboBox></td>
            <td><asp:RequiredFieldValidator runat="server" ControlToValidate ="ddlCostCategory" ID="reqValCostCategory" Text="*" ErrorMessage="Cost Category is required" InitialValue="[Select...]" ></asp:RequiredFieldValidator></td>
        </tr>
      </table>

The combobox si bound to a list with the first item having the text of [Select...] before the Page.Validate is called:

var query2 = from c in PNGC_SmartGridContext.CostCategories select c;
               IList<CostCategory> _costCategories = query2.ToList<CostCategory>();
               _costCategories.Insert(0, new CostCategory() { ID = 0, Name = "[Select...]" });
               ddlCostCategory.DataSource = _costCategories;
               ddlCostCategory.DataBind();

Note that the actual validation on submit works fine, it's just the ability to pre-trigger the red asterisk that would be great.

Thanks

Jonathan
Peter
Telerik team
 answered on 31 Mar 2011
1 answer
67 views
When I click "Add a new record", the Loading... icon at the bottom of the grid spins continuously, but the Edit works fine.

Actually, I found the problem, but I'm not sure how to fix it.

The EditFormType is Template. In the template I have the following:
<td>
    <asp:RadioButtonList ID="CommentLevel_RadioButtonList" runat="server"
                 DataSourceID="CommentLevel_SqlDataSource" DataTextField="CodeValue"
                 DataValueField="CodeName" RepeatDirection="Horizontal"
        
SelectedValue='<%# Eval("CommentCategory") %>'>
    </asp:RadioButtonList>
</td>

The problem is with the SelectedValue. When editing an existing record, there is a value in CommentCategory; but when inserting it is null.

What is the best way for me to conditionally include the SelectedValue property? On a new record, I want don't want a default value -- the user needs to think about which it should be. (An error message displays before saving if null.)
Jayesh Goyani
Top achievements
Rank 2
 answered on 31 Mar 2011
3 answers
127 views
I've got a TreeView in a combo box that works fine. What I'd like to do is keep track of which nodes are expanded in the treeview between pages (I use the control on multiple pages) I've seen code to do a treeview in a combobox and saving a treeview to a session variable but can't seem to get the combination of the two to work correctlty.

Anybody have any suggestions?

TIA - Jeff.
Shinu
Top achievements
Rank 2
 answered on 31 Mar 2011
2 answers
161 views
Is there a way to disable the Chart Title and Chart Legend to NOT be clickable when assigning the Chart a Click event? 

Putting a click event on the item, does not seem to work from code behind.
- item.ActiveRegion.Click += new RegionClickEventHandler(BaseItem_Click);
Item is clickable, but method never gets fired.

I'm using Telerik RadControls for ASP.NET Ajax - version 2010.3.1221.40

Help with any (or both) of the issues above would be greatly appreciated!


Thanks,
Katie

Katie Arnott
Top achievements
Rank 1
 answered on 30 Mar 2011
1 answer
262 views
I have a need to create an Excel Workbook with multiple worksheets and many of those worksheets will have multiple different tables inside of them.

I've learned how to create multiple worksheets but can't seem to figure out how to add multiple tables.  In the below code, you'll see I'm doing that by appending two stringbuilders together.  If I try to append the 2nd set of records ("DashboardFees") to anything other than a TableElement, I can't get it to run without an error.  Any assistance would be appreciated.  Here is what I have.

protected void rgDashboardProduction_GridExporting(object source, GridExportingArgs e)
        {
            IEnumerable<Record> productionRecords = GetDashboardProduction();
            IEnumerable<Record> feeRecords = GetDashboardFees();
 
            StringBuilder sb = new StringBuilder();
            WorksheetElement workSheet = new WorksheetElement("DashboardProduction"); //create new worksheet
            workSheet.Table = ParseRecord(productionRecords);
            
            workSheet.Render(sb); //generate xmlss code
            
            StringBuilder sb2 = new StringBuilder();
            WorksheetElement workSheet2 = new WorksheetElement("DashboardFees"); //create new worksheet
            workSheet2.Table = ParseRecord(feeRecords);
            workSheet2.Render(sb2); //generate xmlss code
 
            string output = string.Concat(sb.ToString(), sb2.ToString());
            e.ExportOutput = e.ExportOutput.Replace("</Styles>""</Styles>" + output); //add the rendered worksheet to the output
        }



private TableElement ParseRecord(IEnumerable<Record> records)
        {
            TableElement table = new TableElement();
            RowElement headerRow;
            RowElement row;
            CellElement cell;
            ColumnElement column;
 
            PropertyInfo[] properties = records.First().Properties;
            int numColumns = properties.Length;
 
            for (int col = 1; col <= numColumns; col++)
            {
                column = new ColumnElement();
                column.Attributes.Add("ss:Width", (100 * col).ToString());
                table.Columns.Add(column);
            }
 
            //Add Header Row
            headerRow = new RowElement();
            foreach (PropertyInfo property in properties)
            {
                cell = new CellElement();
                cell.StyleValue = "headerStyle";
                cell.Data.DataItem = property.Name;
                headerRow.Cells.Add(cell);
            }
 
            //Add Data Rows
            foreach (Record record in records)
            {
                row = new RowElement();
                foreach (PropertyInfo property in record.Properties)
                {
                    cell = new CellElement();
                    cell.Data.DataItem = property.GetValue(record, null);
                    row.Cells.Add(cell);
                }
                table.Rows.Add(row);
            }
 
            return table;
        }


Daniel
Telerik team
 answered on 30 Mar 2011
4 answers
172 views
Hello,

Found an article on drag & drop to multiple destinations here. In my case, it's the opposite -- I need to drag & drop (D&D) from any of four listboxes to a fifth destination listbox.

I noticed that after a first D&D from any of the source listboxes, subsequent D&D operations work only from that initial listbox, but not from any of the other three listboxes -- I assume some reference is not cleared after the first operation.

Can D&D from multiple sources be done "out-of-the-box", or does it need special handling similar to the multiple destination case?

Thanks.
SorinC
Top achievements
Rank 1
 answered on 30 Mar 2011
1 answer
46 views
Hi Admin,

I am getting problem in setting up the names in the radfilter option it shows me the Datafield values by default instead i want to use the Header Text as the Filter options , for Example i had a datafield name 'Customername' now instead of this i only want to show My HeaderText which is 'Customer' in the option. is it possible to do so.


Please reply asap.

Thanks,
Don Tompkins
Top achievements
Rank 1
 answered on 30 Mar 2011
1 answer
159 views
If i want to hide a treelistcolumn from .cs file how can i do it?
Veli
Telerik team
 answered on 30 Mar 2011
6 answers
117 views
Hi,
I wonder if RadScheduler has this following feature. When a user select a day in the past, Radscheduler will not allow him to insert an appointment. Besides, if he adds a new appointment, it is incorrect if he selects a start date and an end date in the past.

Kind regards,
Hai Tran
Hai
Top achievements
Rank 1
 answered on 30 Mar 2011
2 answers
137 views

Hi,

I don't want to use RadScheduler skins as embedded resources. I've been able disable those using EnableEmbeddedBaseStylesheet="false" EnableEmbeddedSkins="false".

However, I haven't been able to disable the css for the calendar inside the RadScheduler. How do I do this?

Thanks,

Andre

André
Top achievements
Rank 1
 answered on 30 Mar 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Top achievements
Rank 1
Iron
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ivory
Top achievements
Rank 1
Iron
Nurik
Top achievements
Rank 2
Iron
Iron
YF
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?