Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
164 views

 Problem: after put rgDataRetrieval.MasterTableView.FilterExpression=... on grid PreRender makes grid all the column filter function not work. Please help!

 

I have a radgrid, has allow filter for all the columns turn to true.
I also need to have a date manually filtered by a search button click to filter the datagrid manually by start and end date.

I put the following code on PreRender, the serach button manually filter works fine, but after put  rgDataRetrieval.MasterTableView.FilterExpression=... in PreRender, the grid column auto filter for all the columns does not work right- not work at all

protected
void rgDataRetrieval_PreRender(object sender, EventArgs e)

 

{

 

 

DateTime startDate =Convert.ToDateTime("1/1/1900");

 

 

 

DateTime endDate = Convert.ToDateTime("1/1/2900");

 

 

 

if (rdpFrom.SelectedDate!=null)

 

startDate=rdpFrom.SelectedDate.Value;

 

 

if (rdpTo.SelectedDate!=null)

 

endDate=rdpTo.SelectedDate.Value.AddDays(1);

 

 

if (rdpFrom.SelectedDate != null || rdpTo.SelectedDate != null)

 

{

rgDataRetrieval.MasterTableView.FilterExpression =

 

null;

 

rgDataRetrieval.MasterTableView.FilterExpression =

 

"(([DownloadEnd] >= '" + startDate +

 

 

 

"') AND ([DownloadEnd] <= '" + endDate + "')) ";

 

rgDataRetrieval.MasterTableView.Rebind();

}

}


Shinu
Top achievements
Rank 2
 answered on 12 Jul 2011
0 answers
81 views
Can not execute button click even when set  autopostback of RadDatePicker properties  is true.
Telerik version: 2011.1.315.40
Help me. please!
hai
Top achievements
Rank 1
 asked on 12 Jul 2011
3 answers
264 views
I have a RadGrid setup so that double clicking a row opens a form under the row to allow editing. The form itself lives in a web user control.

On this form one of the fields is a CheckBox. It looks like this.

<td><asp:CheckBox ID="chkIsActive" runat="server" Checked='<%# DataBinder.Eval( Container, "DataItem.con_Is_Active") %>' /></td>
 
The code in the 'Checked=' bit sees that on edit the Checked property gets set to True or False. Perfect.

However, when I hit the Add New Record button, this line gets a problem.

Specified cast is not valid.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidCastException: Specified cast is not valid.

Source Error:

Line 24:          <tr>
Line 25:          <td align="right">Active:</td>
Line 26:          <td><asp:CheckBox ID="chkIsActive" runat="server" Checked='<%# DataBinder.Eval( Container, "DataItem.con_Is_Active") %>' /></td>
Line 27:          <td></td>
Line 28:         <td></td>

Source File: c:\Dev\RadGrid\RadGrid\Controls\ContactDetails.ascx    Line: 26



It's pretty easy to understand why.  DataItem.con_Is_Active has no value on an Add New Record insert.

My question is, were do I intercept this to prevent this error on Adding a new Record?

I've looked for but have been unable to find the InitInsertButtons click event if any such event exists..

I'm sure this is simple I just don't know where to put such a check.  I suppose what I'd like to do is set the  DataItem.con_Is_Active property some default value (like 'False') before the it gets to this point.

Brad
Top achievements
Rank 1
 answered on 12 Jul 2011
2 answers
117 views
The splitter is similar to the webmail demo (fulscreen)

However when the page loads you can clearly see the splitter be small, then "POP" into fullscreen. 

Is there any way around that??  at least somehow set a default height so the popping isn't so in your face.
sitefinitysteve
Top achievements
Rank 2
Iron
Iron
Veteran
 answered on 11 Jul 2011
2 answers
344 views
Hi,

I was wondering how can I get the index of row in the UpdateCommand events of a TreeList. In a RadGrid, it would be like this :

Guid uniqueIdentifer= Guid.Parse((RadGrid1.Items[e.Item.ItemIndex] as GridDataItem)["UniqueIdentifier"].Text);

But if doesn't work with a treeList. In fact, the proprety e.Item.ItemIndex doesn't seem to exist. So, I look around to found something, but I had no luck. So, may someone tell me how to retrieve the index of the selected row via a updateCommand.

Thank you
David
Top achievements
Rank 1
 answered on 11 Jul 2011
3 answers
470 views
I tried following to export to pdf in Landscape page orientation:

 

RadGridResult.ExportSettings.Pdf.PageHeight = Unit.Parse("215mm")

 

RadGridResult.ExportSettings.Pdf.PageWidth = Unit.Parse("260mm");

But it didn't work, and I have no idea on how to export to Word in Landscape orientation.
But I can do it with Excel just fine. Is there anyway to "convert" Excel to PDF or Word format on the fly?

THanks

LamK.

 

 

 

 

Daniel
Telerik team
 answered on 11 Jul 2011
1 answer
252 views
By default, when we export from RadGrid to  MS Word, it automatically has 1 inches page margin, I would like to programmatically change it to 0.5.

Would you please show me how to do that?

Thanks

LamK
Daniel
Telerik team
 answered on 11 Jul 2011
6 answers
569 views
I have a Radgrid on an ASP.NET form and it is bound to a database table. In the view mode one of the columns has a text value in it that shows a mode. I am using an edit form. In the edit form I have a dropdown on that same field that allows the user to select one of three choices. I can find the dropdown in the edit template using
If TypeOf e.Item Is GridEditFormItem And e.Item.IsInEditMode Then
            dp = e.Item.FindControl("dpRoles")

But what I can't figure how to get is the current data value in the current data row. I know it is in the griddataitem but how do I get to this in the itemdatabound event. I want to "jam" the dropdown list to what is currently in the grid before it goes to edit mode on that row.

Thanks in advance for your help.

Terry
Terry Harrison
Top achievements
Rank 1
 answered on 11 Jul 2011
1 answer
43 views
I have and email sent to a customer upon update with a URL of the ID that gets created.  If they click the URL it should take them directly to the radgrid with the open edititemformtemplate with all of it filled out.  Any ideas on how to accomplish this?
Elliott
Top achievements
Rank 2
 answered on 11 Jul 2011
2 answers
121 views
i have a rad Filter like below. i want to switch out the Display Name based on a condition.

<

 

 

telerik:RadFilter ID="WorkOrdersRadFilter" runat="server" Skin="WebBlue" ShowApplyButton="true"

 

 

 

OnApplyExpressions="WorkOrdersRadFilter_Apply" ApplyButtonText="Filter Work Orders"

 

 

 

OnPreRender="RadFilter_PreRender" OnFieldEditorCreating="RadFilter_FieldEditorCreating"

 

 

 

 

 

OnFieldEditorCreated

 

 

="RadFilter_FieldEditorCreated"

 

 

>
<FieldEditors>

 

 

 

<telerik:RadFilterTextFieldEditor FieldName="WORKORDERNUMBER" DisplayName="Work Order#"

 

 

 

DataType="System.String" />

 

 

 

 

<

 

 

goldcustom:RadFilterComboBoxEditor FieldName="WOTYPENAME" DisplayName="WO Type"

 

 

 

 

 

 

 

DataTextField="WOTYPENAME" DataSourceID="WorkOrderTypeFilterODS" DataType="System.String"

 

 

 

 

 

 

 

ComboBoxSkin="WebBlue" />

 

 

 

 

<

 

 

telerik:RadFilterTextFieldEditor FieldName="TRACKINGNUMBER" DisplayName="Tracking#"

 

 

 

DataType="System.String" />

 

 

 

<telerik:RadFilterTextFieldEditor FieldName="KEYREFERENCE" DisplayName="Key Ref"

 

 

 

DataType="System.String" />

 

</FieldEditors>

 

 

 

</telerik:RadFilter>
i tried what was suggested in one of the tutorials, but it never seems to fire this event.i also tried OnFieldEditorCreating which simply is used to invoke the class for radComboBoxes and that never fires either unless of course it's a radComboBox.
i assume that i want to do this when i click the "Add Expression" button on the RadFilter. is there some way i can switch out the DisplayName?? i've been thru every tutorial i can find, but nothing really works.
can i get some direct help? i'm a registered developer, do you guys need any info from me?
thanks
rik


Want to run something like this to switch out the Display name depending on a condition:

 

protected void RadFilter_FieldEditorCreated(object sender, RadFilterFieldEditorCreatedEventArgs e)

{

    if (e.Editor.FieldName == "WORKORDERNUMBER")

    {

        e.Editor.DisplayName = "My custom text";

    }

}

rik butcher
Top achievements
Rank 1
 answered on 11 Jul 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?