Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
94 views
Hello I want to show footer on radgrid. i have populated my radgrid's rows from code behind. there is no control i placed on radgrid but from code behind.

<telerik:RadGrid ID="gvDayWiseCashReport" runat="server" AutoGenerateColumns="False"
                GridLines="None" OnItemDataBound="gvDayWiseCashReport_ItemDataBound">
                <MasterTableView>
                    <RowIndicatorColumn>
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn>
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </ExpandCollapseColumn>
                </MasterTableView>
            </telerik:RadGrid>
in My code behind on button click...This is how i am populating it
protected void btnSearch_Click(object sender, EventArgs e)
    {
        DaysList daysforList = null;
        Month = int.Parse(ddlMonth.SelectedValue);
        Year = int.Parse(ddlYear.SelectedValue);
  
        GetDates dates = new GetDates();
        FirstDate = dates.GetFirstDayOfMonth(Month, Year);
        LastDate = dates.GetLastDayOfMonth(Month, Year);
  
        days = System.DateTime.DaysInMonth(int.Parse(ddlYear.SelectedItem.Value), int.Parse(ddlMonth.SelectedValue)).ToString();
        int NoofDays = int.Parse(days);
  
        DataSet ds = new DataSet();
        DateTime date;
        CustomSQLCommand command = new CustomSQLCommand(@"select distinct Purpose,Others from tbl_CashRequest req left join tbl_CashPurpose purpose
        on purpose.ID=req.CashPurposeID", false);
        ds = command.ExecuteDataSet();
  
        gvDayWiseCashReport.DataSource = null;
        gvDayWiseCashReport.MasterTableView.Columns.Clear();
        gvDayWiseCashReport.DataBind();
  
        gvDayWiseCashReport.DataSource = ds;
  
        GridBoundColumn boundColumn;
        boundColumn = new GridBoundColumn();
        boundColumn.DataField = "Purpose";
        gvDayWiseCashReport.MasterTableView.Columns.Add(boundColumn);
  
  
        for (int i = 1; i <= NoofDays; i++)
        {
            date = dates.GetDate(int.Parse(ddlMonth.SelectedValue), int.Parse(ddlYear.SelectedItem.Value), i);
            string strDay = date.DayOfWeek.ToString();
            int Day = 0;
            CustomSQLCommand getDay = new CustomSQLCommand(@"select ID from tbl_PreferedTransferDay where PrefferedDay='" + @strDay + "'", false);
            try { Day = int.Parse(getDay.ExecuteScalar()); }
            catch { }
  
            if (Day != 0 && Day != null)
            {
                daysforList = new DaysList();
                GridBoundColumn boundColumn1;
                boundColumn1 = new GridBoundColumn();
  
                boundColumn1.HeaderText = String.Format("{0:ddd, MMM d, yyyy}", date);
                gvDayWiseCashReport.MasterTableView.Columns.Add(boundColumn1);
                daysforList.Day = date;
                daysforList.DayID = Day;
  
                ListDays.Add(daysforList);
            }
            Day = 0;
        }
  
        gvDayWiseCashReport.DataBind();
          
    }
and in item data bound this is how i am writing data on each cell
protected void gvDayWiseCashReport_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            GridDataItem dataItem = (GridDataItem)e.Item;
 
            string purpose = "", others = "";
            if (DataBinder.Eval(e.Item.DataItem, "Purpose").ToString() == "Others")
            {
                e.Item.Cells[2].Text = DataBinder.Eval(e.Item.DataItem, "Others").ToString();
                try { purpose = DataBinder.Eval(e.Item.DataItem, "Purpose").ToString(); }
                catch { }
                try { others = DataBinder.Eval(e.Item.DataItem, "Others").ToString(); }
                catch { }
            }
            else
            {
                try { purpose = DataBinder.Eval(e.Item.DataItem, "Purpose").ToString(); }
                catch { }
                others = "";
            }
 
            CustomSQLCommand cmd = new CustomSQLCommand("[SP_CashRequest_getApprovalDayWise]", true);
 
            cmd.AddInputParameter("@Purpose", purpose, SqlDbType.NVarChar, 200);
            cmd.AddInputParameter("@Others", others, SqlDbType.NVarChar, 200);
 
            DataSet ds = cmd.ExecuteDataSet();
 
            for (int j = 0; j < ListDays.Count; j++)
            {
                e.Item.Cells[j + 3].Text = "";
            }
 
            if (ds.Tables[0].Rows.Count > 0)
            {
                int NoofInstallment = 0;
                string InstallmentType = "", PaymentMethod = "";
                int RequestID = 0, ApprovalID = 0; string Remarks = "";
                string RequestedBy = "", ApprovedBy = "";
                float TotalAmount = 0.0F;
 
                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                {
                    try { NoofInstallment = int.Parse(ds.Tables[0].Rows[i]["NoOfInstallments"].ToString()); }
                    catch { }
                    try { InstallmentType = ds.Tables[0].Rows[i]["ApprovedInstallmentType"].ToString(); }
                    catch { }
                    try { PaymentMethod = ds.Tables[0].Rows[i]["ApprovedPaymentType"].ToString(); }
                    catch { }
                    try { Remarks = ds.Tables[0].Rows[i]["ActionRemarks"].ToString(); }
                    catch { }
                    try { ApprovedBy = ds.Tables[0].Rows[i]["ActionTakenBy"].ToString(); }
                    catch { }
                    try { RequestedBy = ds.Tables[0].Rows[i]["RequesterName"].ToString(); }
                    catch { }
                    try { TotalAmount = int.Parse(ds.Tables[0].Rows[i]["ApprovedAmount"].ToString()); }
                    catch { }
                    try { ApprovalID = int.Parse(ds.Tables[0].Rows[i]["ApprovalID"].ToString()); }
                    catch { }
 
                    cfmsBL.ApprovalID = ApprovalID;
 
                    #region Single Installments
                    if (PaymentMethod == "Single time")
                    {
                        DateTime CashTransferDay = DateTime.MinValue;
                        float Amount = 0.0F;
                        String TransferDayIDs = "";
                        try { TransferDayIDs = ds.Tables[0].Rows[i]["ApprovedTransferDayIDs"].ToString(); }
                        catch { }
                        try { CashTransferDay = DateTime.Parse(ds.Tables[0].Rows[i]["ApprovedCashTransferDay"].ToString()); }
                        catch { }
 
                        DataSet dsTransfer = new DataSet();
 
                        if (TransferDayIDs != "" && TransferDayIDs != null)
                        {
                            DataSet dsTransferDays = DB.CFMS_DB.GetByIDs(TransferDayIDs);
                            if (dsTransferDays.Tables[0].Rows.Count > 0)
                            {
                                TransferDayIDs = "";
                                for (int k = 0; k < dsTransferDays.Tables[0].Rows.Count; k++)
                                {
                                    try { TransferDayIDs = TransferDayIDs + dsTransferDays.Tables[0].Rows[k]["PrefferedDay"].ToString() + ","; }
                                    catch { }
                                }
                                TransferDayIDs = TransferDayIDs.Substring(0, TransferDayIDs.Length - 1);
                            }
                            cfmsBL.DaysName = TransferDayIDs.Split(',');
                        }
 
                         
 
 
                        for (int j = 0; j < ListDays.Count; j++)
                        {
                            cfmsBL.Dates = "";
                            DateTime dateNext = DateTime.MinValue;
                            DateTime dateCurr = DateTime.MinValue;
                            dateCurr = ListDays[j].Day;
                            try { dateNext = ListDays[j + 1].Day; }
                            catch { }
                            if (CashTransferDay == ListDays[j].Day)
                            {
                                if (e.Item.Cells[j + 3].Text == "")
                                {
                                    try { Amount = int.Parse(ds.Tables[0].Rows[i]["ApprovedAmount"].ToString()); }
                                    catch { }
                                }
                                else
                                {
                                    try { Amount = float.Parse(e.Item.Cells[j + 3].Text.ToString()) + float.Parse(ds.Tables[0].Rows[i]["ApprovedAmount"].ToString()); }
                                    catch { }
                                }
                                try { e.Item.Cells[j + 3].Text = Amount.ToString(); }
                                catch { }
}
}
}
Now i want to show the summ of each column on footer. please tell me how to acheive this. I have attached the snap of the grid.
shahid Aleem
Top achievements
Rank 1
 answered on 27 Jul 2010
1 answer
69 views
In IE8, when I load the following HTML into the editor:

<html><head></head><body><table><tr><td width="*"></td></tr></table></body></html>

I get the following javascript error:

"Error while executing filter CleanAttributesFilter - Error: Invalid argument."

I suspect this is related to the width="*" attribute. When I take this out, the editor loads without showing the message.
Rumen
Telerik team
 answered on 27 Jul 2010
6 answers
171 views
Hi,

Does the RadTreeview in 2010.Q2 force AutoIDs now (and not allow us to Statically set IDs any longer as we could in Q1)?

With Q2, when I select a RadTree, then go to properties > ClientIDMode, it won't let me select anything other than AutoID.  (even though the other 4 choices appear (Inherit, AutoID, Predictable, and Static).  And now the Q2 Treeview also ignores my code-behind that was statically setting IDs to dynamically created RadComboBoxes.  (eg.)

...
 ddlItem.ClientIDMode = UI.ClientIDMode.Static
 ddlItem.ID = "ddlItem_" + strOrderDetailID
treenodeItem.Controls.Add(ddlItem)

 









This was working great in Q1, and would create an ID such as "ddlItem_12345",
but as soon as I upgraded to Q2, it was stuck in AutoID mode, and the controls
had "id="ctl00_ContentPlaceHolder1_RadTreeView2_i0_i0_ddlItem_12345" again (as it was before .net 4.0)

Am I missing some new setting?

Thanks,
Mike
Nikolay Tsenkov
Telerik team
 answered on 27 Jul 2010
4 answers
164 views
Consider the following page ...
  <head runat="server">
    <title></title>
  </head>
  <body>
    <form id="form1"
          runat="server">
      <telerik:radscriptmanager runat="server"></telerik:radscriptmanager>
      <br/>
      <br/>
      <br/>
      <br/>
      <br/>
      <br/>
      <div>
        <telerik:RadWindow ID="winDetail"
                           runat="server"
                           Behaviors="None"
                           Left="686px"   
                           Height="452px"
                           Top="130px"
                           VisibleOnPageLoad="true"
                           VisibleStatusbar="false"
                           VisibleTitlebar="false"
                           Width="300px"
                           style="margin-bottom: 49px">
          <ContentTemplate>
            <telerik:RadComboBox ID="RadComboBox1"
                                 runat="server">
              <Items>
                <telerik:RadComboBoxItem Value="1"
                                         Text="Monday"/>
                <telerik:RadComboBoxItem Value="2"
                                         Text="Tuesday"/>
                <telerik:RadComboBoxItem Value="4"
                                         Text="Wednesday"/>
                <telerik:RadComboBoxItem Value="8"
                                         Text="Thurday"/>
                <telerik:RadComboBoxItem Value="16"
                                         Text="Friday"/>
                <telerik:RadComboBoxItem Value="32"
                                         Text="Saturday"/>
                <telerik:RadComboBoxItem Value="64"
                                         Text="Sunday"/>
              </Items>
            </telerik:RadComboBox>
            <telerik:RadEditor ID="RadEditor1"
                               runat="server"
                               EnableResize="false"
                               ContentAreaMode="Div"
                               EditModes="Design"
                               Height="100px"
                               NewLineBr="false"
                               ToolbarMode="ShowOnFocus"
                               ToolsFile="~/App_Data/Editor/ToolsFileLimited.xml"
                               Width="256px">
            </telerik:RadEditor>
            <telerik:RadDatePicker Runat="server"></telerik:RadDatePicker>
          </ContentTemplate>
        </telerik:RadWindow>
 
      </div>
    </form>
  </body>
</html>

Run the page. Click on the combobox and the dropdown appears. Click on the datepicker button and the calendar appears.

Now, click on the editor and the toolbar appears, but subsequent clicks on the other 2 controls will, seemingly, fail to display the popups.

In fact, they do display but behind the window.

-- 
Stuart
Stuart Hemming
Top achievements
Rank 2
 answered on 27 Jul 2010
1 answer
156 views
I have few Buttons in my application and I want them to have a default color style, hover style and active style.  When the user clicks the button, I want it to  have a red background untill the request is processed and changes are made in the aplication.Using FormDecorator I could only implement hover style and default style but not active style. Is it possible to style button with certain background untill request is ended?

I donot want to use progress bar to let the user know that request is being processed, I just want the button to have a different color when it is in active phase.

Any Idea?

Thanks
Prava
Bozhidar
Telerik team
 answered on 27 Jul 2010
1 answer
98 views
When my page loads the insert template is visible...how do I go about changing that?  I just want to show the list of items, and if a user is an admin show them a button to enable the insert.

Thanks,
Steve
Rosen
Telerik team
 answered on 27 Jul 2010
3 answers
937 views

Need help with the following:.

I am loading a treeview on pageload.
The user clicks on a button... at serverside I want to insert several new nodes to a Parent Node only if the child nodes does not already exists.

Now I can find the parent node... it exists.  By doing the following I thought I get a count of the "child" nodes.  I am getting 0 (zero) count event though that node (that I found) has child nodes.

 

pNode = rtv.FindNodeByValue(nodeVal.ToUpper(),

true);

 

 

if (pNode != null)

 

{

    int count =  pNode.Nodes.Count

 

 

}

How can I determine if a node has child nodes serverside?
Thanks.

Veronica
Telerik team
 answered on 27 Jul 2010
3 answers
329 views
Hi,

I would like to display the data in radgrid which will pick the xml data.

Following is my query:

I have a data in XML string in my code in the following format

<Customers>
<CustomerID>1</CustomerID>
<CustomerName>xxx</CustomerName>
<CustomerID>2</CustomerID>
<CustomerName>yyy</CustomerName>

</Customers>

I would like to display the above data in radgrid like following

CustomerID            CustomerName
1                              xxx
2                              yyy

I don't have the data in physical XML file and all the above data will in XML string.

I had a chance to look at the demo examples, unfortunately i could not find the solution.

Kindly help me...

If possible please post a sample code.

Thanks,
Shashi
Daniel
Telerik team
 answered on 27 Jul 2010
1 answer
193 views
With a standard multiline textbox I can add

onFocus='this.style.height=300px' 
onBlur='this.style.height=100px' 


How do I acomplish this with the RadTextBox?

I setup a shared javascript function to handle the resizing of the RTB by passing a paramater, but I can't seem to pass parameters to it. 
function resizeRTB(obj, height, width)
{
obj._originalTextBoxCssText = "width:" + width + "px;height:" + height + "px;"; obj.updateCssClass();
}

If I do something like this, I get JavaScript errors because I'm trying to pass parameters to the function
<telerik:RadTextBox ID="rtbExample" runat="server" TextMode="MultiLine"  Width="550px" Height="150px" EmptyMessage="Example text..."  ClientEvents-OnFocus='resizeRTB(this,300,550);'  ClientEvents-OnBlur='resizeRTB(this,150,550);' />

I need one function to handle a whole set of dynamically created RadTextBoxes, so I need the function to be reusable. Could someone guide or point me to what I'm doing wrong here?
Pavel
Telerik team
 answered on 27 Jul 2010
1 answer
60 views
Hello,

Custom skin is not proper applied to Grid,FormDecorator for button,textbox,Calendar,Combobox etc... telerik control.I created skin from the http://stylebuilder.telerik.com/New.aspx.
I have post my issue on below link.Currently i used 2009.1.527.35 version.

http://www.telerik.com/community/forums/aspnet-ajax/style-builder/custom-skin-is-not-applied-proper-in-2009-1-527-35-telerik-version.aspx

pls help me.

Thanks
Jignesh Patel
Alex Gyoshev
Telerik team
 answered on 27 Jul 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Hiba
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
Max
Top achievements
Rank 1
Veteran
Iron
Alina
Top achievements
Rank 1
Rakhee
Top achievements
Rank 1
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?