Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
223 views

Hi,

I have a RadGrid with a CommandItemTemplate.In the InstantiateIn I define a toolbar and add two buttons.

After clicking the button I do a Rebind of the grid in the ItemCommand-event of the grid and I change the text of the clicked button. This fires also the InstantiateIn event of the CommandItemTemplate, so the text of the button is reset.

If I store the text in a property and want to acces this one I get the error:

Cannot access non-static field in static context

I have a kind of sollution with going to the parent of the container like ( container.Parent.Parent.Parent ect) to approach the property. But is there a better approach to change the text of the buttons after clicking them. And I cannot do this client side.

regards, Richard

Peter Milchev
Telerik team
 answered on 21 Oct 2016
1 answer
814 views
I see these tags from time to time.  <qsf:whatever... but when I google Telerik qsf I don't get anything that explains what it stands for or why I would use it.  So what's the deal?
Marin Bratanov
Telerik team
 answered on 21 Oct 2016
1 answer
364 views

Hi,

Please let me know can I use Talarik's control to edit MS Word file online? The one I tried with online demo at: https://demos.telerik.com/aspnet-ajax/editor/examples/ms-word-like-experience/defaultcs.aspx disturbed the format of MS Word file and also remove the forms fields.

I want my users to edit MS Word file containing Form Fields and save them back. Is it possible with Telerik  in Asp.Net ?

Marin Bratanov
Telerik team
 answered on 21 Oct 2016
2 answers
225 views

Hi,

I have search everywhere.

Documentation( Really poor documentation on  Pivot ) , Knowledge Base ( Last post 2015, the second last 2012 ) , Forum well ..

Is it possible to add a "Real link" in the cell of a PivotGrid.
By real , I mean base on data that are in the result set but are not diplayed. Things like id, number that are never displayed to Customer.

I would like to show some more information based on fields that are in the result set but are not diplayed.
Its to mutch information for a little tooltips.

I need to create a link with "~/Somewhere/MyDetailPage.aspx?P=HiddenRowField&Filter=ColumnField"


As its seems to be impossible to get multiple field value into a cell template.
If I add a button in the cell template. Will I be able to retrieve Row/Column Field Value Of the clicked Button ?

 

Konstantin Dikov
Telerik team
 answered on 21 Oct 2016
1 answer
434 views

I have a grid control with a GridTemplateColumn that contains an ItemTemplate and an InsertItemTemplate.  The InsertItemTemplate contains a dropdown list.  The problem is that I get a null reference exception when I try to insert a new record.  I know that the issue lies in the code behind where I am using the following line:

new_doc_stat_cmd.Parameters.AddWithValue("@docStat", rg_doc_stats.MasterTableView.FindControl("docStatDdlInsert"));

 

When I replace the above line with the one below, the insert command is executed successfully:

new_doc_stat_cmd.Parameters.AddWithValue("@docStat", 4);

 

Here is the code for the grid:

<telerik:RadGrid
                ID="rg_doc_stats"
                runat="server"
                DataSourceID="sdc_doc_stats"
                AllowSorting="True"
                Skin="Office2010Blue"
                CellSpacing="-1"
                GridLines="Both"
                OnInsertCommand="rg_doc_stats_InsertCommand">
                <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True"></ClientSettings>
                <MasterTableView DataSourceID="sdc_doc_stats" AutoGenerateColumns="False" DataKeyNames="docStatIdPk" CommandItemDisplay="Top">
                    <Columns>
                        <telerik:GridBoundColumn DataField="docStatIdPk" ReadOnly="True" HeaderText="docStatIdPk" SortExpression="docStatIdPk" UniqueName="docStatIdPk" DataType="System.Int32" FilterControlAltText="Filter docStatIdPk column"></telerik:GridBoundColumn>
                         
                        <telerik:GridTemplateColumn DataField="docStat" HeaderText="Status" SortExpression="docStat" UniqueName="docStat" DataType="System.Int32" FilterControlAltText="Filter docStat column">
                            <ItemTemplate>
                                <asp:Label runat="server" Text='<%# Bind("stat") %>' ID="statLbl"></asp:Label>
                            </ItemTemplate>
                            <InsertItemTemplate>
                                <asp:DropDownList ID="docStatDdlInsert" runat="server" SelectedValue='<%# Bind("docStat") %>' DataSourceID="sdc_stats" DataTextField="stat" DataValueField="statIdPk" AppendDataBoundItems="true"><asp:ListItem Value="">--Please Select--</asp:ListItem></asp:DropDownList>
                            </InsertItemTemplate>
                        </telerik:GridTemplateColumn>
 
                        <telerik:GridBoundColumn DataField="docStatDt" HeaderText="Status Date" SortExpression="docStatDt" UniqueName="docStatDt" FilterControlAltText="Filter docStatDt column" DataType="System.DateTime" ReadOnly="true"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="docStatSetBy" HeaderText="Status Set By" SortExpression="docStatSetBy" UniqueName="docStatSetBy" FilterControlAltText="Filter docStatSetBy column" ReadOnly="true"></telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="docIdFk" HeaderText="docIdFk" SortExpression="docIdFk" UniqueName="docIdFk" DataType="System.Int32" FilterControlAltText="Filter docIdFk column" ReadOnly="true"></telerik:GridBoundColumn>
                         
                    </Columns>
                </MasterTableView>
            </telerik:RadGrid>
        </telerik:RadPageView>

 

Here are the InsertParameters from the SqlDataSource:

<InsertParameters>
<asp:Parameter Name="docStat" Type="Int32"></asp:Parameter>
<asp:Parameter Name="docStatDt" Type="DateTime"></asp:Parameter>
<asp:Parameter Name="docStatSetBy" Type="String"></asp:Parameter>
<asp:Parameter Name="docIdFk" Type="Int32"></asp:Parameter>
 </InsertParameters>

 

Here is the InsertCommand from the SqlDataSource:

InsertCommand="INSERT INTO [docStats] ([docStat], [docStatDt], [docStatSetBy], [docIdFk]) VALUES (@docStat, @docStatDt, @docStatSetBy, @docIdFk)"

 

Here is the InsertCommand from the code behind:

protected void rg_doc_stats_InsertCommand(object sender, GridCommandEventArgs e)
        {
            SqlConnection drap_cnxn = new SqlConnection("Server=Mine\\SQLEXPRESS;Initial Catalog=drap;Integrated Security=True;");
            {
                SqlCommand new_doc_stat_cmd = new SqlCommand("Insert Into docStats(docStat, docStatDt, docStatSetBy, docIdFk) Values(LTRIM(RTRIM(@docStat)), LTRIM(RTRIM(@docStatDt)), LTRIM(RTRIM(@docStatSetBy)), LTRIM(RTRIM(@docIdFk)))", drap_cnxn);
                new_doc_stat_cmd.Parameters.AddWithValue("@docStat", rg_doc_stats.MasterTableView.FindControl("docStatDdlInsert"));               
                new_doc_stat_cmd.Parameters.AddWithValue("@docStatDt", DateTime.Now.ToString());
                new_doc_stat_cmd.Parameters.AddWithValue("@docStatSetBy", HttpContext.Current.User.Identity.Name);
                new_doc_stat_cmd.Parameters.AddWithValue("@docIdFk", hdn_doc_id.Value);
 
                drap_cnxn.Open();
                new_doc_stat_cmd.ExecuteNonQuery();
                drap_cnxn.Close();
 
                if (IsPostBack)
                {
                    rg_ven_docs.DataBind();
                    rg_doc_stats.DataBind();
                }                   
            }
        }

 

Thank you,

J

Vasil
Telerik team
 answered on 21 Oct 2016
1 answer
146 views
Is it possible to have two grids on the same page that are synced to use the first gids header menus? I am trying to use the "excel like filtering" but I am having issues with refreshing both grids from one header.
Kostadin
Telerik team
 answered on 21 Oct 2016
1 answer
126 views

Hi,

I have a RadGrid2 inside Radgrid1 Edit form Template. When RadGrid1 is in edit mode, the command item row shrinks. I checked my css and that's not the problem. Has anyone ever dealt with this before?

Thanks

Konstantin Dikov
Telerik team
 answered on 21 Oct 2016
11 answers
1.2K+ views
Following a crash of Visual Studio I'm experiencing an issue where all of my Telerik tags on my aspx pages have blue underlines.  Mousing over the underlined tags reveals the following error message "Unrecognized tag prefix or device filter 'telerik'".  I've also lost Telerik intellisense.  Does anyone know what the solution is? I've tried removing and re-adding all of the Telerik references and bin files.  This did not fix the problem.

Note, prior to Visual Studio crashing I had made only a few minor text edits to the project...nothing that major that I would expect could have caused these problems.  I'm using VS 2010.
headPropellerHead
Top achievements
Rank 1
 answered on 21 Oct 2016
14 answers
901 views
Hello,
   I am connecting to my SSAS server but I am no showing any data when the page loads, no fields in the Configuration Panel as well.  I know my connection string is correct because we currently use it with an OWC control we hope to replace with the PivotGrid, and I can also connect through Excel.  I have tried connection both through the HTML markup as well as the code behind:
<OlapSettings ProviderType="Adomd">
              <AdomdConnectionSettings
                  Cube="Leads"
                  DataBase="DBName"
                  ConnectionString="Provider=MSOLAP.5;Data Source=ServerName;User ID=webuser;Initial Catalog=DBName;" >
 
              </AdomdConnectionSettings>
          </OlapSettings>
I have not defined any columns as the examples I have seen on  your site have not shown that they need to be predefined, which would defeat the purpose of the control.
I have also tried in the code behind:
rpg.OlapSettings.ProviderType = Telerik.Web.UI.PivotGridOlapProviderType.Adomd
     rpg.OlapSettings.AdomdConnectionSettings.Cube = "Leads"
     rpg.OlapSettings.AdomdConnectionSettings.DataBase = "DBName"
     rpg.OlapSettings.AdomdConnectionSettings.ConnectionString = "Provider=MSOLAP.5;Data Source=ServerName;User ID=XXX;Initial Catalog=DBName;"

Is there is something I am missing or I am doing wrong?  I have been through the threads here and checked numerous examples, but just can't seem to get it.
Any help would be great.  I am getting frustrated

Thanks,
Jim
Vasil
Telerik team
 answered on 20 Oct 2016
2 answers
242 views

Hello, I've been using the export to excel settings in the rad grid, which works great, but many of the users that work with my system have been complaining on the button size since it seems to be pretty small, I tried to change it myself but didn't seem to find a property to do that, I've only been able to change the command items bar but the button stays the same size.

Is there any way to change the button size and place for the "CommandItemSettings ShowExportToExcelButton"?

I leave my code below

        <MasterTableView  CommandItemDisplay="Top">
    <CommandItemSettings ShowExportToExcelButton="true" ShowAddNewRecordButton="false" ShowExportToPdfButton="true" ShowRefreshButton="false"/>

Thanks a lot!
Virgilio
Top achievements
Rank 1
 answered on 20 Oct 2016
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?