Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
188 views
I have a radgrid on my page
<telerik:RadGrid ID="RadGrid1" runat="server" Skin="Office2007" AllowPaging="True"
                            PageSize="25" AutoGenerateColumns="False" GridLines="None" AllowSorting="True"
                            AllowFilteringByColumn="true" AlternatingItemStyle-BackColor="#eeeeee" ShowGroupPanel="True"
                            ShowStatusBar="True" OnNeedDataSource="RadGrid1_NeedDataSource" OnItemCommand="RadGrid1_ItemCommand"
                            OnPageIndexChanged="RadGrid1_PageIndexChanged" OnPageSizeChanged="RadGrid1_PageSizeChanged"
                            OnItemCreated="RadGrid1_ItemCreated" OnPreRender="RadGrid1_PreRender" Width="100%" >
                            <AlternatingItemStyle BackColor="#EEEEEE"></AlternatingItemStyle>
                            <MasterTableView DataKeyNames="ExcelImportID" PagerStyle-Mode="NextPrevNumericAndAdvanced" AllowFilteringByColumn="True">
                                <AlternatingItemStyle BackColor="#EEEEEE"></AlternatingItemStyle>
                                <RowIndicatorColumn>
                                    <HeaderStyle Width="20px"></HeaderStyle>
                                </RowIndicatorColumn>
                                <Columns>
                                    <telerik:GridBoundColumn SortExpression="ClientName" DataField="ClientName" HeaderText="Client Name"
                                        HeaderStyle-Width="300px">
                                        <FilterTemplate>
                                            <telerik:RadComboBox ID="RadComboBoxClientName" DataTextField="ClientName" DataValueField="ClientName"
                                                AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("ClientName").CurrentFilterValue %>'
                                                runat="server" Skin="Office2007" AutoPostBack="true" OnSelectedIndexChanged="ClientCombo_SelectedIndexChanged" />
                                        </FilterTemplate>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn SortExpression="BankName" DataField="BankName" HeaderText="Bank Name"
                                        HeaderStyle-Width="300px">
                                        <FilterTemplate>
                                            <telerik:RadComboBox ID="RadComboBoxBankName" DataTextField="BankName" DataValueField="BankName"
                                                AppendDataBoundItems="true" SelectedValue='<%# ((GridItem)Container).OwnerTableView.GetColumn("BankName").CurrentFilterValue %>'
                                                runat="server" Skin="Office2007"  AutoPostBack="true" OnSelectedIndexChanged="BankCombo_SelectedIndexChanged" />
                                        </FilterTemplate>
                                    </telerik:GridBoundColumn>
                                    <telerik:GridBoundColumn DataField="ExcelFile" HeaderText="Excel File Name" SortExpression="ExcelFile"
                                        HeaderStyle-Width="300px" UniqueName="ExcelFile" Visible="True" />
                                    <telerik:GridBoundColumn DataField="ImportBy" HeaderText="Imported By" SortExpression="ImportBy"
                                        UniqueName="ImportBy" Visible="True" />
                                    <telerik:GridBoundColumn DataField="ImportDate" HeaderText="ImportDate" SortExpression="ImportDate"
                                        UniqueName="ImportDate" Visible="True" DataType="System.DateTime" DataFormatString="{0:MM/dd/yyyy}" />
                                    <telerik:GridBoundColumn DataField="ProcessedBy" HeaderText="Processed By" SortExpression="Error"
                                        UniqueName="ProcessedBy" Visible="True" />
                                    <telerik:GridBoundColumn DataField="ProcessedDate" HeaderText="Processed Date" SortExpression="Processed Date"
                                        UniqueName="ProcessedDate" Visible="True" DataType="System.DateTime" DataFormatString="{0:MM/dd/yyyy}" />
                                </Columns>
                                <PagerStyle Mode="NextPrevNumericAndAdvanced"></PagerStyle>
                            </MasterTableView>
                            <ClientSettings AllowDragToGroup="True">
                            </ClientSettings>
                        </telerik:RadGrid>

and in the code behind I have

protected void BankCombo_SelectedIndexChanged(object o, RadComboBoxSelectedIndexChangedEventArgs e)
      {
          string filterExpression;
          filterExpression = "([BankName] = '" + e.Value + "')";
          RadGrid1.MasterTableView.FilterExpression = filterExpression;
          RadGrid1.MasterTableView.Rebind();
    }

but when I run I get the erroe Expression expected on the Rebind().  What is wrong?
Eric Klein
Top achievements
Rank 1
 answered on 01 Sep 2010
2 answers
101 views
Hello

I want to customize my Area chart to look like the one I attached.
Is it possible to modify point's X position so that I can insert additional points to achieve only horiziontal and vertical lines between points ?



Adam Kochanowski
Top achievements
Rank 1
 answered on 01 Sep 2010
8 answers
168 views
Using version 2008.1.515.20

I found another thread that mentioned anchor tags have been fixed in a recent version, but I'm wondering if there is any workarounds for those of us that are unable to upgrade at this time? The problem seems to stem from what the rad window adds to the querystring.

http://localhost/dialogs/popupgeneric.aspx#shipping?rwndrnd=0.8012201152955385  doesnt work, but
http://localhost/dialogs/popupgeneric.aspx#shipping does.
Georgi Tunev
Telerik team
 answered on 01 Sep 2010
1 answer
146 views
I have two questions regarding the HeaderContextMenu in the grid:

1) How do I prevent the menu from posting back on click? I have a client-side event handler:

<HeaderContextMenu OnClientItemClicked="grid_HeaderContextMenu_ClientItemClicked" />

In this handler, I do all the processing I need client-side. However, after that client code executes, the grid still posts back. How do I prevent this? I've tried calling set_cancel(true) on the eventArgs, but the eventArgs in this case doesn't have that method. I've also tried doing the eventArgs.get_domEvent().stopPropagation() and preventDefault() as is shown in other code elsewhere, but that doesn't work either. The postback defeats my whole purpose of doing the processing client-side.

2) How do I customize the context menu options based on the column? I have added two new options to the context menu (which I add during the OnPreRenderComplete). For most of the columns, these two new options are valid, but for one column, they are not valid and so I want to hide them for only that column. How can I do this? It doesn't matter if I do this client-side or server-side.

Thanks.
Pavlina
Telerik team
 answered on 01 Sep 2010
2 answers
227 views
Hello, I'm creating a RadScheduler context menu dynamically.  I call the method to create the menu in the Page Onload event.  This works great unti I switch a view.  Even though in the OnLoad event I can see that the Scheduler has my custom context menu items, when I right-click, I get the default menu shown.  Is this something that has a workaround?
Dasha
Top achievements
Rank 1
 answered on 01 Sep 2010
1 answer
158 views
Hi, is there a sample on counting rows in each group and displaying the count in the group header or footer?


Thanks
Pavlina
Telerik team
 answered on 01 Sep 2010
1 answer
152 views
Hello,
After much research I still can't figure out how to set the selected value in a resource list. My Resources appear ok, and the correct value is added to the database, but on update, it always selects the 1st data value in the list no matter what the database value. It does not select the "-" unless my data field is null which is correct.

My appointment population loop below.

for (int i = 0; i < appCol.Count; i++)
            {
  
                Appointment apt = new Appointment();
                apt.Owner = owner;
                apt.ID = appCol[i].Id;
                apt.Start = DateTime.SpecifyKind(Convert.ToDateTime(appCol[i].Start), DateTimeKind.Utc);
                apt.End = DateTime.SpecifyKind(Convert.ToDateTime(appCol[i].End), DateTimeKind.Utc);
                apt.RecurrenceRule = Convert.ToString(appCol[i].RecurrenceRule);
                apt.Description = appCol[i].Description;
                // load Apppointment Type Resources
                apt.Resources.AddRange(GetResourcesByType(owner,"Appointment Types"));
             
                if (appCol[i].RecurrenceParentId != null)
                    apt.RecurrenceParentID = appCol[i].RecurrenceParentId;
  
                int reminderTime = 0;
  
                if (Int32.TryParse(appCol[i].Reminder,out reminderTime))
                {
                    Reminder r = new Reminder(reminderTime);
                    apt.Reminders.Add(r);
                    Tools.SetAppointmentsForApplication();
                }
  
                if (apt.RecurrenceParentID != null)
                {
                    apt.RecurrenceState = RecurrenceState.Exception;
                }
                else if (apt.RecurrenceRule != string.Empty)
                {
                    apt.RecurrenceState = RecurrenceState.Master;
                }
  
  
                apt.Subject += appCol[i].Subject;
                appointments.Add(apt);
            }
Veronica
Telerik team
 answered on 01 Sep 2010
1 answer
115 views
I am creating a line chart programmatically.

The chart has a datetime value for the xaxis and a numerical count for the yaxis.

If the yaxis values are +ve it all works fine but if there is a -ve value in the data, the chart does not plot and i get the error message 'There is no or empty series'

Here is the code used to create the chart:

int gridItem = (int)dataItem.GetDataKeyValue("PlayerCode");
 
RadChart1.Series.Clear();
RadChart1.Clear();
RadChart1.PlotArea.XAxis.Clear();
 
string scoreQuery = "SELECT [ScoreDate], [ScoreValue] FROM [Scores] WHERE ([PlayerCode] = @PlayerCode) AND ([ScoreValue] > 0) ORDER BY [ScoreDate] ASC";
Connections scCon = new Connections(scoreQuery);
scCon.AddParam("PlayerCode", gridItem);
DataTable resTable = new DataTable();
resTable = scCon.ReturnTable();
ChartSeries chSeries = new ChartSeries();
chSeries.Type = ChartSeriesType.Line;
ChartAxisItem xAxis = new ChartAxisItem();
RadChart1.PlotArea.XAxis.IsZeroBased = false;
RadChart1.PlotArea.XAxis.AutoScale = false;
RadChart1.PlotArea.XAxis.Appearance.ValueFormat = Telerik.Charting.Styles.ChartValueFormat.ShortDate;
 
foreach (DataRow dr in resTable.Rows)
{
    chSeries.AddItem(Convert.ToDouble(dr["ScoreValue"]));
    DateTime scDate = new DateTime();
    scDate = Convert.ToDateTime(dr["ScoreDate"]);
    ChartAxisItem item = new ChartAxisItem();
    item.Value = (decimal)scDate.ToOADate();
    RadChart1.PlotArea.XAxis.AddItem(item);
}
RadChart1.PlotArea.Appearance.FillStyle.FillType = Telerik.Charting.Styles.FillType.Gradient;
RadChart1.PlotArea.Appearance.FillStyle.MainColor = Color.FromArgb(78, 198, 19);
RadChart1.PlotArea.Appearance.FillStyle.SecondColor = Color.FromArgb(123, 230, 108);
RadChart1.Series.Add(chSeries);
Any help is much appreciated.
Ves
Telerik team
 answered on 01 Sep 2010
7 answers
408 views
I'm doing some testing with the RadGrid CalculatedColumn.  It's a timesheet application so I'd like to use the GridCalculatedColumn to total the hours for the week (row) and sum aggregate to total the hours for the day (column).  Some days won't have hours so the datafield will pull in NULL.  The sum aggregates are working fine but the GridCalculatedColumn is not displaying a value. 

Here is the code for my columns:
<rad:GridNumericColumn Aggregate="Sum" FooterAggregateFormatString="{0:F}" DataFormatString="{0:F}" DataField="Hours_Sun" DataType="System.Decimal" HeaderText="SUN" /> 
<rad:GridNumericColumn Aggregate="Sum" FooterAggregateFormatString="{0:F}" DataFormatString="{0:F}" DataField="Hours_Mon" DataType="System.Decimal" HeaderText="MON" /> 
<rad:GridNumericColumn Aggregate="Sum" FooterAggregateFormatString="{0:F}" DataFormatString="{0:F}" DataField="Hours_Tue" DataType="System.Decimal" HeaderText="TUE" /> 
<rad:GridNumericColumn Aggregate="Sum" FooterAggregateFormatString="{0:F}" DataFormatString="{0:F}" DataField="Hours_Wed" DataType="System.Decimal" HeaderText="WED" /> 
<rad:GridNumericColumn Aggregate="Sum" FooterAggregateFormatString="{0:F}" DataFormatString="{0:F}" DataField="Hours_Thu" DataType="System.Decimal" HeaderText="THU" /> 
<rad:GridNumericColumn Aggregate="Sum" FooterAggregateFormatString="{0:F}" DataFormatString="{0:F}" DataField="Hours_Fri" DataType="System.Decimal" HeaderText="FRI" /> 
<rad:GridNumericColumn Aggregate="Sum" FooterAggregateFormatString="{0:F}" DataFormatString="{0:F}" DataField="Hours_Sat" DataType="System.Decimal" HeaderText="SAT" /> 
<rad:GridCalculatedColumn Aggregate="Sum" FooterAggregateFormatString="{0:F}" DataFormatString="{0:F}" DataFields="Hours_Sun, Hours_Mon, Hours_Tue, Hours_Wed, Hours_Thu, Hours_Fri, Hours_Sat" Expression="{0}+{1}+{2}+{3}+{4}+{5}+{6}" DataType="System.Decimal" HeaderText="WEEK TOTAL" /> 

In one row example, there are hours in only Monday and Tuesday.  If I changed the DataFields to "Hours_Mon, Hours_Tue" and the Expression to "{0}+{1}" then the CalculatedColumn works correctly.  Am I only allowed to do a calculation on 2 data fields or is it running into a problem with the null values for the rest of the days? Am I missing a property in my columns?
Radoslav
Telerik team
 answered on 01 Sep 2010
1 answer
79 views
Dear fellows,

i just start with AJAX, because since the last weeks i was more involved in the RadControl for ASP.Net and Winforms.

i've noticed that most on my classic asp.net controls (in .ascx controls) don't fire the server side event code on first click, but on 2nd.

So what i am doing is, that i have one contentPlaceHolder in a master page and i drop my user controls on it.

I have added a ScriptManager to the master page.

Where to place AjaxManager and/or AJAX Panel to make sure that defined classic ASP.NET controls are behaving like before?

Specially my asp:Buttons are not working as expected and i need to execute server side code on first click.

So what is the best pratice for this.

2nd: in my apllication some buttons should appear only, if some steps was done before, means the user has to follow a defined way, and first when she/he has finished Step 2 - the BVutton for Step 3 becomes visible.

Because there is not databinding for buttons i currently use session variables for this taks. Any better way to do it ?

Thanks for helping.

Kind Regards

Martin Gartmann
Martin Gartmann
Top achievements
Rank 2
 answered on 01 Sep 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?