Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

Juvil John

@Juvil John
About
Posts
27
Topics
15
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • threading in a Custom Collection
    J Juvil John

    that does not fire an error the "details" is created on the same thread. as the "grid1". not the comment I expected but thanks for the reply.

    modified on Wednesday, August 12, 2009 5:07 AM

    C# css design tutorial question

  • threading in a Custom Collection
    J Juvil John

    Hi All, I'd like to make a separate thread in inserting of data into the Custom Collection I have and fires an event when its done so it would be bound to a grid. Is it possible? here is my example code.

    public class Details : List<Details.Detail>
    {
        public delegate void \_WorkComplete();
        public event \_WorkComplete WorkComplete;
    
        public void AddDataSource(object value)
        {
            Thread worker = new Thread(new ParameterizedThreadStart(dowork));
            worker.Start(value);
        }
    
        private void dowork(object value)
        {
            ArrayList list = (ArrayList)value;
            foreach (Item item in list)
            {
                this.Add(new Detail { FIELD1 = item.Code1, FIELD2 = item.Code2 });
            }
            if (WorkComplete != null) WorkComplete();
        }
    
        public class Detail
        {
            private string field1;
            private string field2;
    
            public Detail()
            {
                field1 = string.Empty;
                field2 = string.Empty;
            }
    
            public string FIELD1
            {
                get { return field1; }
                set { field1 = value; }
            }
    
            public string FIELD2
            {
                get { return field2; }
                set { field2 = value; }
            }
        }
    }
    

    so in the UI side i could do

    private Details details = new Details();

    protected void Page_Load(object sender, EventArgs e)
    {
    details.OnWorkComplete += new Details._WorkComplete(details_AddComplete);
    details.AddDataSource(source1);
    details.AddDataSource(source2);
    }

    void details_AddComplete()
    {
    grid1.DataSource = details;
    grid1.DataBind();
    }

    C# css design tutorial question

  • Fooling DataPager Control
    J Juvil John

    any other way?

    ASP.NET help css tutorial

  • Fooling DataPager Control
    J Juvil John

    Hi, I need to know how to fool a data pager. I have a grid which is bound to a List, and since I am not using object data source I need to manually manage the paging event for the grid. now my grid is paged using datapager control, and I have a scenario. when I do a paging event, I take the current page, and the pagesize to get the exact items to bind to the grid. using skip and take method, I managed the paging well. but the problem comes when I bind the paged rows the datapager does not work anymore, since its taking the data from the grid which only have the exact rows, it tends to render that it does not have a next/prev page. now I need to fool the datapager of the exact rows that I am paging or have a fix datapager fields. any suggestion would be great.

    ASP.NET help css tutorial

  • Entity Framework Question
    J Juvil John

    How do I instantiate an EntityObject with a Referencekeys for browsable objects. I'd like to do an XML to LINQ then convert it back as an entity object. now my problem is when I do this.

    GIVEN:
    XML from store procedure
    <Peoples>
         <People>
              <Name>name1</Name>
              <Work><Work>
              <Nickname>name1nick</Nickname>
         </People>
    </Peoples>
    
    People --> EntityObject
    People.Work --> Browsable Object (one to many relation)
    People.NickName --> Extended property, not a EdmScalarPropertyAttribute (just a simple custom scalar string property)
    
    var list = from peoples in XMLResult.Descendants("Peoples")
    select new People
    {
    Name = peoples.Element("Name").Value,
    Work = ??? (How do I load the this?), should I do (Work = _ObjectContext.Work.WorkID.Equals(peoples.Element("Work").Value), "Query in the object context?"
    Nickname = peopls.Element("Nickname").Value
    };
    
    Now you might be thinking why not just do this...
    
    var list = from people [ObjectContext].People
    select people;
    

    The reason is because People.NickName property is not a Table column, the data is generated from the stored procedure (which I had other processes) and is return as XML; If i skip People.Work it would give an error. hope its clear.

    C# question database help csharp linq

  • Polymorphism Questions with EntityFramework
    J Juvil John

    I have a this class structure Class1 -> EF (EntityObject from the Entity Data Model) CustomClass1 : Class1 -> Custom class Inherited class from EntityObject Class1 now I wanted to CustomClass1 custom1 = new CustomClass1; Class1 baseclass = (Class1)CustomClass1; baseclass = ( LINQ to EDM Query).First(); now how do i load back the baseclass object to custom1 (CustomClass1)??

    LINQ question csharp database linq oop

  • Custom Made EDM
    J Juvil John

    Hi all, basically i'm trying to encapsulate the data access layer aside from the business layer like so... will this work? so far im getting an error "unable to load metadata resources" when adding a connection string. <pre>using System; using System.Collections.Generic; using System.Linq; using System.Text; [assembly: global::System.Data.Objects.DataClasses.EdmSchemaAttribute()] [assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("NorthwindModel", "FK_Products_Categories", "Categories", global::System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(EDM.TEST.Northwind.Categories), "Products", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(EDM.TEST.Northwind.Products))] [assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("NorthwindModel", "FK_Orders_Customers", "Customers", global::System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(EDM.TEST.Northwind.Customers), "Orders", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(EDM.TEST.Northwind.Orders))] [assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("NorthwindModel", "FK_Employees_Employees", "Employees", global::System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(EDM.TEST.Northwind.Employees), "Employees1", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(EDM.TEST.Northwind.Employees))] [assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("NorthwindModel", "FK_Orders_Employees", "Employees", global::System.Data.Metadata.Edm.RelationshipMultiplicity.ZeroOrOne, typeof(EDM.TEST.Northwind.Employees), "Orders", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(EDM.TEST.Northwind.Orders))] [assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("NorthwindModel", "FK_Order_Details_Orders", "Orders", global::System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(EDM.TEST.Northwind.Orders), "Order_Details", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(EDM.TEST.Northwind.Order_Details))] [assembly: global::System.Data.Objects.DataClasses.EdmRelationshipAttribute("NorthwindModel", "FK_Order_Details_Products", "Products", global::System.Data.Metadata.Edm.RelationshipMultiplicity.One, typeof(EDM.TEST.Northwind.Products), "Order_Details", global::System.Data.Metadata.Edm.RelationshipMultiplicity.Many, typeof(EDM.TEST.Northwind.Order_Details))] [assembly: global::System.Data.Ob

    LINQ csharp linq business help question

  • Custom web controls
    J Juvil John

    I am having a pretty weird problems with my custom web controls. basically to start it all, I have a custom web user control, written in C# as a Class inherit as User Control. What it does is like a bread crumbs approach control, if you guys are familiar. I am using a modal pop up extender, a grid pops up then with a separate data pager, when the grid fires selectedIndexchange event then just basically append a dynamic link button into the placeholder with added event onclick to basically just remove it self from the placeholder if clicked. now my problems are. 1. when I get to the last item in the place holder, the onclick event won't fire, it hides itself from the users view, and shows itself back when another link button is added into the placeholder and that's not all, in debug mode there is no event that can capture all those what's happening in that linkbutton when i clicked it, it just hides and yes even javascript on click event can't capture it. 2. datapager in the pop up goes haywire when i click the next button, it hides. I am aware that this might be a problem on how I render the control, but even if I tried this approach in an actual web page and not as a usercontrol I still get the same problems aside from the datapager. I am not trying to find a solution cause this is a really hard problem believe me, if there is then I would welcome it. I just wanted to know if anyone has the same experience? thanks.

    ASP.NET csharp javascript css debugging help

  • GridView Control - EditItemTemplate Controls
    J Juvil John

    thanks dude. twas a great article.

    ASP.NET css sysadmin docker question

  • GridView Control - EditItemTemplate Controls
    J Juvil John

    what link?

    ASP.NET css sysadmin docker question

  • GridView Control - EditItemTemplate Controls
    J Juvil John

    Hi, I have a grid, which has an ItemTemplate and an EditItemTemplate, my concern is how do I get the controls in the EditItemTemplate, my grid columns looked like this... <asp:TemplateField HeaderText="Price Type" HeaderStyle-CssClass="first" SortExpression="PriceType"> <ItemTemplate> <asp:Label ID="lbl_pricingtype" runat="server" Text='<%# DataBinder.Eval(Container.DataItem, "PriceType[0].PriceTypeDesc[0].Description")%>' ToolTip='<%# DataBinder.Eval(Container.DataItem, "PriceType[0].PriceType")%>'></asp:Label> </ItemTemplate> <EditItemTemplate> <asp:DropDownList ID="ddl_pricingtype" runat="server" CssClass="first" Width="90px" onchange="ddl_pricingtype_change(this.value)"> <asp:ListItem Text="Please Select" Value="-1"></asp:ListItem> <asp:ListItem Text="0 - Price1" Value="0"></asp:ListItem> <asp:ListItem Text="1 - Price2" Value="1"></asp:ListItem> <asp:ListItem Text="2 - Price3" Value="2"></asp:ListItem> </asp:DropDownList> </EditItemTemplate> <HeaderStyle CssClass="first" /> <ItemStyle CssClass="first" /> </asp:TemplateField> Now I can get the value from the ItemTemplate label using OnRowEditing event but I can't seem to find the Dropdownlist control to set the selecteditem.

    ASP.NET css sysadmin docker question

  • Binding Generic Collections to an ASP.GridView
    J Juvil John

    Hi, I have a generic object of type List<Items> with a sub collection of objects of type List<Descriptions>. I want to bind them to a gridview but not sure if it's possible, I have tried binding only the object of type List<Items> but if I try adding an ItemTemplate with another grid to try to bind the object of type List<Descriptions> i'm getting an error. says "it should implement IDatasource." something. my column structure in the grid would look like this.

    <Columns>
    <asp:BoundField DataField="Key" HeaderText="Key" SortExpression="Key" />
    <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />
    <asp:TemplateField HeaderText="Descriptions" HeaderStyle-CssClass="headerstyle">
    <ItemTemplate>
    <asp:GridView ID="gv_descriptions" runat="server" DataSourceID='<%# DataBinder.Eval(Container.DataItem, "Descriptions") %>' AutoGenerateColumns="false"
    AllowPaging="true" EnableViewState="false" BorderStyle="None" GridLines="None" ShowEmptyTable="true" AllowSorting="true">
    <Columns>
    <asp:BoundField DataField="Description" HeaderText="ShortDescription" SortExpression="ShortDescription" />
    </Columns>
    </asp:GridView>
    </ItemTemplate>
    </asp:TemplateField>
    </Columns>

    ASP.NET css wpf wcf sysadmin docker

  • Re-using usercontrol into a different project.
    J Juvil John

    up... anyone?

    ASP.NET tutorial question

  • Re-using usercontrol into a different project.
    J Juvil John

    Hi, This is what i had in mind.

    Solution1
    -Project1
    -Default.aspx
    -Project2
    -UserControl\Usercontrol1.ascx
    -Default.aspx

    Now, what I need is to use Usercontrol1.ascx to Default.aspx in Project1. Usercontrol1.ascx is used in local Default.aspx in Project2. Also Project1 & Project2 are in the same solution under Solution1. So anyone knows how to do this? Thanks.

    ASP.NET tutorial question

  • What's wrong with this code?
    J Juvil John

    I have not actually found out whats really causing this but I re design my code and somehow got this to work. here's what i'm using now.

    private delegate void _Post_Result(object data);

        private void Post\_Result(object data)
        {
            if (lvThreads.InvokeRequired)
            {
                //This means that calling was accessed in separate thread
                upd = new \_Post\_Result(Post\_Result);
                this.lvThreads.Invoke(upd, new object\[\] { data });
            }
            else
            {
                //This means that calling of lvThreads is in main thread
                lvitem = (ListViewItem)data;
                this.lvThreads.Items\[lvitem.Index\].SubItems\[1\].Text = 
                    Convert.ToString(Convert.ToInt32(lvitem.SubItems\[1\].Text) + 1);
            }
        }
    
    C# help question

  • What's wrong with this code?
    J Juvil John

    yes data is already an array. parameter in control.invoke refers to the number of parameters you pass this through in that case "upd" which is refered to Post_Results which contains only 1 param so thats the reason why you have to place the data into another array.

    C# help question

  • What's wrong with this code?
    J Juvil John

    im confused either where im getting this wrong... anyone can try the code?

    C# help question

  • What's wrong with this code?
    J Juvil John
        private delegate void \_Post\_Result(object\[\] data);
    
        private void Post\_Result(object\[\] data)
        {
            if (lvThreads.InvokeRequired)
            {
                //This means that calling was accessed in separate thread
                \_Post\_Result upd = new \_Post\_Result(Post\_Result);
                //this.lvThreads.Invoke(upd, data);
                **this.lvThreads.Invoke(upd, new object\[\] { data });**
            }
            else
            {
                //This means that calling of lvThreads is in main thread
                ListViewItem lvitem = (ListViewItem)data\[0\];
                this.lvThreads.Items\[lvitem.Text\].SubItems\[1\].Text = Convert.ToString(data\[1\]);
            }
        }
    

    I am getting this error "Parameter count mismatch" in the bold line...

    C# help question

  • How to Set Media Format when Ripping CD in Windows media player 11 SDK
    J Juvil John

    Anyone knows how to set media format when ripping CD? e.i. WMA, MP3... and also the bitrate? Thanks.

    Visual Basic tutorial question

  • disable/enabled tabpages in tabcontrol
    J Juvil John

    Just remove the tabpage and add it again if you want to use it. tbSpecialAddMain.TabPages.RemoveAt(1) tbSpecialAddMain.TabPages.Add(tbpMarketingDetails) Or use this Private Sub TabControl1_Selecting(ByVal sender As Object, ByVal e As System.Windows.Forms.TabControlCancelEventArgs) Handles TabControl1.Selecting '\\Disable Selection of tabpage1 If TabControl1.SelectedIndex = 1 Then TabControl1.SelectTab(2) End If End Sub

    Visual Basic tutorial
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups