.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Creating a pivot of a collection and displaying it in a databound grid with dynamic columns

Posted By:      Posted Date: September 28, 2010    Points: 0   Category :.NET Framework


I'm trying to create a pivot of some data that I have about translation.

Basically what I have now is a collection of "Translation" objects which look like that :

Public Class SystemText
  Inherits Entity

#Region "Private variables"
  Private _textCategory As String
  Private _textName As String
  Private _languageCode As String
  Private _description As String
#End Region

#Region "Properties"
  Public Overridable Property TextCategory() As String

View Complete Post

More Related Resource Links

Creating dynamic template columns in gridview

how to create dynamic template columns in gridview  . I have writing some of the code but it gives me error The type or namespace name 'GridViewLabelTemplatecould' not be found (are you missing a using directive or an assembly reference?)    I have paste some my code /con.Open();        string strsql = "select ID,CompanyName from tblcompany";               SqlCommand cmd = new SqlCommand();        cmd.CommandType = CommandType.Text;        cmd.CommandText = strsql;        cmd.Connection = con;        SqlDataAdapter adpt = new SqlDataAdapter();        adpt.SelectCommand = cmd;        adpt.Fill(dt);        GridView1.Columns.Clear();        for (int i = 0; i < dt.Columns.Count; i++)        {            TemplateField tf = new TemplateField();            // create the data rows       

displaying dynamic added value in reports



I my application i have generated dynamic rows that contains some textbox values, i need to take those values and display in

reports. I am storing that dynamically added values in another table. please help me.

Dynamic .NET: Creating Interactive Bing Maps with Silverlight and IronRuby


Silverlight provides support for dynamic languages such as IronRuby and IronPython. We'll walk you through the creation of a custom Silverlight control using Bing Maps and IronRuby.

Ashish Ghoda

MSDN Magazine February 2010

Design Patterns: Creating Dynamic Factories in .NET Using Reflection


Design patterns are a powerful tool for designing flexible soft-ware. They provide well-tested solutions to recurring software design problems. One such widely used pattern is the Concrete Factory.

Romi Kovacs

MSDN Magazine March 2003

Custom Grid View Header - Grid view Row Created event vs Gridview row databound events ?


Hi Gurus ,

It happened to add an extra Gridveiw Header in row_databound event , It did worked fine on !Postback but disappered on Page.Postback . Quick google search guided me to move the event to Row_Created event and every thing is okay .

Can any expert post some pointers , differnces between grid row_created vs row_databount with some sample table data created dynamically  behaviour of both the events in !Postback and page.Postback .

Thanks a tonne in Advance and  any inputs will be valued and appreciated .

Filtering a grid column when the column is bound to a collection


My SetUp (I am using EF for my data):

1 Grid bound to a collection of Vehicle Objects

1 Combobox with multiselect enabled bound to a list of VehicleExtras.

Each vehicle has a collection of extras. 

My Problem:

What I need to do is have the Grid filter Vehicles based on whether those vehicles have the selected VehicleExtras from the Combobox

Can anyone point me in the right direction as to how this filtering should be done (if it is at all possible!)



Creating List Definitions with Custom List Columns for SharePoint Server 2007

Learn to use Visual Studio 2008 Extensions for Windows SharePoint Services to create a SharePoint list definition that implements custom list columns.

dynamic creating controls in webpart


Hello everybody,


My webpart (wss 3.0, VS2005) initialy contain a listbox. Depeding on the selection made a certain amount of textboxes are to be created and rendered. Via these dynamically created / rendered textboxes text can be submitted (via a button), for futher processing.


I am not sure how, or where in the webpart code, to dynamically create these textboxes.


Maybe somebody can give me some advise on this topic.


Thanks in advance









Help with creating dynamic XAML

Hi,  I need some help creating a complex XAML. I have a HotelRoom table with the below fields, ID Hotel HotelName Date RoomType Quantity  1    34    Hilton        3/5     Single      30  2    34    Hilton        3/6     Single      30  3    34    Hilton        3/7    Double     100  4    39    Express     3/5     King         10  5    39    Express     3/6    Double      20 Now I want the UI to display as a list of different records of Hotels with room details in them and I have created an object that has all the fields from the HotelRoom table,   HILTON               Single     Double    3/5        30          0    3/6 &n

Re;Creating Dynamic Control

Hi, I have a table which stores the data like mentioned below ID Name Values 1 States Karnataka,Tamilnade,AP,UP 2 Karnataka Bangalore, Mysore, Bidar 3 tamilnadu Salem,Chennai,Pondicherry 4 AP Hyderbad,Secunderabad,Vishakapatanam 5 UP Delhi,Agra Now i have to create a dynamic controls for each and every states from the above table. A Sate Name should be dispalyed with checkbox on check of checkbox i have to enable all the cities which is again associated with the checkbox.How do i simulate this functionality using dynamic checkbox and labels. Please help me with a sample code.

gridview help on each dynamic row solve this show values based on all columns

<asp:GridView style="Z-INDEX: 101; LEFT: 1px; POSITION: absolute; TOP: 183px" id="Gridview1" runat="server" Width="613px" Height="127px" ForeColor="Teal" Font-Size="12pt" Font-Names="Palatino Linotype" Font-Bold="True" Visible="False" BorderColor="Transparent" AutoGenerateColumns="false" CellSpacing="2" GridLines="None" OnRowCreated="Gridview1_RowCreated" SelectedIndex="5" ShowFooter="true" OnRowDataBound="Gridview1_RowDataBound"><Columns>  <asp:TemplateField HeaderText="ItemCode"><ItemTemplate> <asp:DropDownList id="DropDownList1" tabIndex=16 runat="server" AutoPostBack="True" DataValueField=" ItemCode " DataTextField=" ItemCode" ></asp:DropDownList></ItemTemplate></asp:TemplateField>  <asp:TemplateField HeaderText="ItemName"><ItemTemplate> <asp:DropDownList id="DropDownList2" tabIndex=16 runat="server" AutoPostBack="True" DataValueField="ItemName" DataTextField="ItemName" ></asp:DropDownList> </ItemTemplate> </asp:TemplateField>  <asp:TemplateField HeaderText="Category"&

need help in creating XML Schema Collection

I have below sample data from a system, Table X Col_Name                DataType  systemName            string  SystemVersion         Decimal  SubmitedOn             DateTime Now, I m creating below XML by above data in C#, <Source_XML>   <SystemName Value="Timesheet" Name=""></SystemName>   <SystemVersion Value="1.0" Name=""></SystemVersion>   <SubmitedOn Value="08/31/2010" Name=""></SubmitedOn> </Source_XML>   Now I need to prepare XML SCHEMA for above XML by C# and register the same in SQL 2005...so that nxt time we can validate above XML. Please someone suggest me how to do above functionality....creating schema at runtime by C# and register the same schema into SQL 2005 database. thanks,

Creating a new root Site Collection using a custom site definition file (ONET.XML)

Using Powershell, I am trying to deploy the our custom solution to SP 2010.  The script is doing the following: Deleting the web application using Remove-SPWebApplication Creating a new web application using New-SPWebApplication Adding and deploying a series of WSP files (one of which has the site definition file in it) using Add-SPSolution and Install-SPSolution Create a root site collection based on the site definition file provided in the WSPs using New-SPSite I get the error "WARNING: Template is not found and is not applied." When I run Get-SPWebTemplate, my site definition does not show up. I saw this: http://social.msdn.microsoft.com/Forums/en/sharepoint2010general/thread/5ea46e07-a4b0-4bab-b698-9b6eeb695607 but I want a solution that does not involve me reloading a DLL, as, I feel there is something else I am forgetting. I have also tried: IISReset Resetting the timer service Cleaning the Cache (as described here: http://support.microsoft.com/kb/939308) Nothing seems to work.  Does anyone have any ideas?

Error when creating PK to a column which has dupliacte columns..

The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'table name' and the index name 'PK__column__118068EB'. The duplicate key value is (D1).

Error Creating Site Collection

Hello, I have created a basic claims-based web app in SharePoint 2010. When I try to create a Site Collection, after filling out all the details, I get the following error:   Error  Cannot complete this action. Please try again.  Troubleshoot issues with Microsoft SharePoint Foundation.  Correlation ID: 349b9ae9-7bda-41eb-921a-87974afb289c    I have tried ever which way to try and get it to work, but am still stuck. Any ideas as to why I can't create a Site Collection? Thanks!

Error when creating site collection through programmatically?

hi all, When i am creating SharePoint Site collection through programmatically i am getting an error message. i am using below code...   using (SPSite site = new SPSite("http://servername:7853/")) {   using (SPWeb web = site.OpenWeb()) {   SPWebApplication oweb = web.Site.WebApplication; site.AllowUnsafeUpdates = true;   SPSiteCollection sitecol = oweb.Sites;   SPSite site1 = oweb.Sites.Add("sites/DemoSiteCol", "DemoSiteCol", "Welcome to the Client SiteCol",1033, "STS#0", "Domian\\user", "display name", "user@domian.com");//here i am getting the error message as "Object refernce not set to an instance of an Object". oweb.Update(); } Please tell me why i am getting the error message.... thanks in advance.....

which one is better site template or site collection template for creating site collection?

hi all, i want to create site collection by using custom template. So I created one site and i saved as a template and i want to use this site template to create site collection...can we use site template  or site collection template to create site collections? what is the difference between site template and site collection template? please advise me which one is better..... thanks in advance...
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend