Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
250 views
  Below is the gridview rowcommand code which i want to convert in radgrid itemdatabound any budy have solution

protected void Gridviiew_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            try
            {
                if (e.Row.RowType == DataControlRowType.Header)
                {
                    dtTotalDuration = Convert.ToDateTime("01/01/1900");
                    dtTotalTimeSpent = Convert.ToDateTime("01/01/1900");
                }
                else if (e.Row.RowType == DataControlRowType.DataRow)
                {
                    Int32 intRow = e.Row.RowIndex + 1;

                    int intSeconds;
                    string strValue;
                    string strHtml;

                    //strHtml = "javascript:var w=window.showModalDialog('Course.aspx?ChapterNum=" + intRow.ToString() + "', null, 'dialogHeight=700px; dialogTop=75px; dialogLeft=250px; dialogWidth=800px; edge=Raised; center=No; help=Yes; resizable=no; status=no; scroll=yes');";
                    strHtml = "javascript:var w=openCourse('" + intRow.ToString() + "', '" + Session["CID"].ToString() + "');";
                     //   e.Row.Cells[4].Attributes.Add("OnClientClick", "function_Name()");

                    //Add New
                    string strhtmlnew1 = "javascript:RadWindowOpenCourse('" + intRow.ToString() + "', '" + Session["CID"].ToString() + "');";
                    e.Row.Cells[4].Attributes.Add("OnClick", "javascript:RadWindowOpenCourse('" + intRow.ToString() + "','" + Session["CID"] + "');return false;");
                   
                    strValue = DataBinder.Eval(e.Row.DataItem, "Course_Duration").ToString();
                    intSeconds = clsCommonData.MyInt32Convert(strValue.Substring(0, 2)) * 3600 + clsCommonData.MyInt32Convert(strValue.Substring(3, 2)) * 60 + clsCommonData.MyInt32Convert(strValue.Substring(6, 2));
                    dtTotalDuration = dtTotalDuration.AddSeconds(Convert.ToDouble(intSeconds));

                    strValue = DataBinder.Eval(e.Row.DataItem, "Customer_Duration").ToString();
                    intSeconds = clsCommonData.MyInt32Convert(strValue.Substring(0, 2)) * 3600 + clsCommonData.MyInt32Convert(strValue.Substring(3, 2)) * 60 + clsCommonData.MyInt32Convert(strValue.Substring(6, 2));
                    dtTotalTimeSpent = dtTotalTimeSpent.AddSeconds(Convert.ToDouble(intSeconds));
                }
                else if (e.Row.RowType == DataControlRowType.Footer)
                {
                    e.Row.Cells[1].Text = dtTotalDuration.ToString("HH:mm:ss");
                    e.Row.Cells[2].Text = dtTotalTimeSpent.ToString("HH:mm:ss");
                }
            }
            catch (Exception ex)
            {
                if (ex.Message.Substring(0, 56) != "Specified argument was out of the range of valid values.")
                {
                    clsErrorLogData.LogError("Content", "Gridviiew_RowDataBound", ex.Source + "_" + Common_App.MyString(Session["CID"]), ex.Message, "");
                }
            }
        }
Princy
Top achievements
Rank 2
 answered on 05 Jul 2013
1 answer
79 views
is it possible to loop thru the "stand alone" radFilter and get the FieldNames + any Vaule used rather than have a huge GLOB of text to Parse thru?
i've been using RadFilters for over three years and don't really need a link to a tutorial unless it specifically shows this function. i was wondering if it's even possible.
usually i wind up w/ this to deal with:
 WHERE  (WORKORDERNUMBER LIKE '12345%' AND TRUNC(INVOICEDATE) >= TO_DATE('7/1/2013 12:00:00 AM','MM/DD/YYYY HH12:MI:SS AM') AND PROFITCENTERCODE LIKE '0708%')

this is great for tacking onto a dynamic query - but, i'd like to be able to capture which field was used and what value was passed.
thx
rik


 

 

<telerik:RadFilter ID="VolSummaryRadFilter" runat="server" Skin="WebBlue" ShowApplyButton="true" OnFieldEditorCreating="VolSummaryRadFilter_FieldEditorCreating"

 

 

 

OnPreRender="VolSummaryRadFilter_PreRender" OnApplyExpressions="VolSummaryRadFilter_Apply" Visible="false" OnItemCommand="VolSummaryRadFilter_ItemCommand">

 

 

 

<FieldEditors>

 

 

 

 

<telerik:RadFilterDateFieldEditor FieldName="INVOICEDATE" DisplayName="Invoice Date"

 

 

 

DataType="System.DateTime" MinDate="1/1/1900" />

 

 

 

 

<

 

 

telerik:RadFilterTextFieldEditor FieldName="PROFITCENTERCODE" DisplayName="Profit Ctr Code"

 

 

 

 

 

 

 

DataType="System.String" />

 

 

 

 

<

 

 

telerik:RadFilterTextFieldEditor FieldName="WORKORDERNUMBER" DisplayName="WorkOrder #" DataType="System.String" />

 

 

 

</FieldEditors>

 

 

 

</telerik:RadFilter>

 

Kostadin
Telerik team
 answered on 05 Jul 2013
3 answers
257 views
Hi,
i am new to telerik controls.i used RAD Progress Area control in my project.if i use it with out update panel,it works as expected.when i place it with in update panel the progress area is not closing even after the process is over.i add RadProgressContext.OperationComplete = true;.
but no luck.how to do this.
Thanks.
Shinu
Top achievements
Rank 2
 answered on 05 Jul 2013
5 answers
215 views

When using radfilter in radwindow like the following example, This radwindow/radfilter is shared my all the gird filter through my site.

http://demos.telerik.com/aspnet-ajax/filter/examples/filterinradwindow/defaultcs.aspx

If I have GridDateTimeColumn on the grid and have TimePicker and DatePicker as PickerType for separate column, On the filter, how can I check the GridDateTimeColumn PickerType to show date only (no time icon) when PickerType is DatePicker and show time only ( no date icon) when PickerType is TimePicker ?

Thanks

Antonio Stoilkov
Telerik team
 answered on 05 Jul 2013
11 answers
227 views
RadTimePicker pop Window is not working with Google Chrome & Apple Safari  .
Though it is working fine with IE & Mozilla Firefox.  
Daniel
Telerik team
 answered on 05 Jul 2013
1 answer
113 views
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<WeBOC.DAL.Vessel>" %>
 
<%@ Register assembly="Telerik.Web.UI" namespace="Telerik.Web.UI" tagprefix="telerik" %>
<script runat="server">
 
    protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
    {
        RadGrid1.DataSource = ViewData["Vessels"];               
    }
</script>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Index
</asp:Content>
 
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
 
    <form id="form2">
     
 
    <h2>Vessels<telerik:RadScriptManager ID="RadScriptManager1" Runat="server">
        </telerik:RadScriptManager>
    </h2>
     
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="False"
        CellSpacing="0" GridLines="None" Skin="WebBlue"
        onneeddatasource="RadGrid1_NeedDataSource" AllowPaging="True"  PagerStyle-Mode="NextPrevNumericAndAdvanced">
        <MasterTableView>
<CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
 
<RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column"></RowIndicatorColumn>
 
<ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column"></ExpandCollapseColumn>
            <Columns>
                <telerik:GridBoundColumn DataField="VIR_NO" HeaderText="VIR No." />
                <telerik:GridBoundColumn DataField="INBOUND_VOY_NO" HeaderText="I/B Voyage" />
                <telerik:GridBoundColumn DataField="OUTBOUND_VOY_NO" HeaderText="O/B Voyage" />
                <telerik:GridBoundColumn DataField="VESSEL_NAME" HeaderText="Vessel Name" />
                <telerik:GridBoundColumn DataField="ARRIVAL_DATE" HeaderText="Arrived" />
                <telerik:GridBoundColumn DataField="STATE" HeaderText="Phase" />               
                <telerik:GridTemplateColumn FilterControlAltText="Filter TemplateColumn column"
                    UniqueName="TemplateColumn">
                    <ItemTemplate>
                            <asp:HyperLink ID="HyperLink1" runat="server" Text="View"
                            NavigateUrl='<%#Url.Action("Inspector","Vessel",new{id=Modal.VSSL_CALL_ID}) %>'></asp:HyperLink>
                        </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
 
<EditFormSettings>
<EditColumn FilterControlAltText="Filter EditCommandColumn column"></EditColumn>
</EditFormSettings>
 
<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
        </MasterTableView>
 
<PagerStyle PageSizeControlType="RadComboBox"></PagerStyle>
 
<FilterMenu EnableImageSprites="False"></FilterMenu>
 
    </telerik:RadGrid>
 
     
    </form>
 
</asp:Content>


Have a look at the above code, when it runs, it stuck at  NavigateUrl='<%#Url.Action("Inspector","Vessel",new{id=Modal.VSSL_CALL_ID}) %>'>

and says that object reference not set to an instance of an object. How do i achieve the functionality that when i click on this hyperlink, the id of the selected row will pass to the desired controller?

Thanks
Ovais
Andrey
Telerik team
 answered on 05 Jul 2013
6 answers
156 views
hey - i have a custom filter for combox in a telerik filter  that i'd like to be typeable.
it's built in to the other radComboboxes:
can you suggest anything that i could use to make this possible - below is part of that initialize of the class:
i tried using [comboBox.EnableLoadOnDemand = true;] - but i dont know how to refernce the Object DataSouce to pick what's being typed in the filter ComboBox.
mark up is included:

 

 

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

 

 

 

OnPreRender="InventoriesRadFilter_PreRender" OnApplyExpressions="InventoriesRadFilter_Apply"

 

 

 

ApplyButtonText="Filter Inventory" OnFieldEditorCreating="RadFilter_FieldEditorCreating" OnItemCommand="InventoriesRadFilter_ItemCommand">

 

 

 

<FieldEditors>

 

 

 

<goldcustom:RadFilterComboBoxEditor DataSourceID="GetCustInvODS" FieldName="OWNER_COMPANYNAME" DisplayName="Owner Name" ComboBoxSkin="WebBlue" ComboBoxWidth="350px"

 

 

 

DataType="System.String" />

 

 

 

</FieldEditors>

 

 

 

</telerik:RadFilter>

 

THE ODS [need somehow to get what's typed in the RadFilterComboBoxEditor above

 

 

public DataTable getCustForInventory()

 

{

 

 

DataTable dt = new DataTable();

 

 

 

int[] myLoc = DivisionIDArray;

 

 

 

using (InventoryBC ibc = new InventoryBC())

 

{

dt = ibc.GetCustomerForInventory(myLoc,

 

"" );

 

 

 

return dt;

 

}

}




THE CLASS:

 

 

public override void InitializeEditor(Control container)

 

{

comboBox =

 

new RadComboBox();

 

comboBox.ID =

 

"ComboBoxEditor" + FieldName;

 

comboBox.DataSourceID = DataSourceID;

comboBox.OnClientSelectedIndexChanged =

 

"clientSelectedIndexChanged";//changes focus to the default button of the page

 

comboBox.OnClientLoad =

 

"clientSelectedIndexChanged";//changes focus to the default button of the page so, 1st item in the list can be selected

 

comboBox.DataTextField = (

 

String.IsNullOrEmpty(DataTextField)) ? FieldName : DataTextField;

 

comboBox.DataValueField = (

 

String.IsNullOrEmpty(DataValueField)) ? FieldName : DataValueField;

 

comboBox.Skin = ComboBoxSkin;

comboBox.Width = ComboBoxWidth;

container.Controls.Add(comboBox);

}

Antonio Stoilkov
Telerik team
 answered on 05 Jul 2013
1 answer
101 views
I'm currently working with a number of RadCharts and a RadGrid. When a RadChart is clicked I switch its skin from black to deep red to show that it has been selected. This functionality works just fine. When one of the other charts is clicked a message is broadcast to all other charts to change their skin back to black if they were deep red. The line of code is called and the variable RadChart1.Skin is set to black, but the appearance of the chart maintains the deep red skin. If I set "SkinsOverrideStyles" to true the chart does change correctly, but it changes my legend back to SeriesName rather than ItemLabels (as well as changing a few other things I have set) so that solution doesn't seem plausible. Is there any reason why the chart would only correctly change skins once? As I previously stated even with SkinsOverrideStyles set to false it makes the change from Black to Deep Red without any problems, the issue is when I try to switch back from Deep Red to Black.
Nikolay
Telerik team
 answered on 05 Jul 2013
8 answers
543 views
I have a RadGrid that is residing on a small RadWindow.  I want to disable/disallow the Page Size dropdown option on the grid interface.  How can this be done?  Thanks for any help in advance.
he
Top achievements
Rank 1
 answered on 05 Jul 2013
2 answers
72 views
Hi,

Just upgraded radeditor to the latest version from an very old version (.net 1.1 site), now my site is running on .net 4.0, I have removed all the old telerik dll files and new rad editor seems working fine, I can edit/save the content, however, when I open the image manager from rad editor, image manager page is loaded, and the default folder in image manager is correct, I can see the sub-folders, but I can't see the (image) files, although it does say 'items 1 to 100 of 101', also none of the buttons is working on image manager page...

any help would be appreciated!

AUK
Top achievements
Rank 1
 answered on 04 Jul 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?