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
  1. Home
  2. General Programming
  3. C#
  4. on run time

on run time

Scheduled Pinned Locked Moved C#
databasehelpcareer
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • T Offline
    T Offline
    TAREQ F ABUZUHRI
    wrote on last edited by
    #1

    if i have table with one col salary ------- 5 9 7 i want to make comboBox for each record in the database the probelm now how can make (onchange) even for each comboBox and save direct to database ... plz help

    Palestine

    P 1 Reply Last reply
    0
    • T TAREQ F ABUZUHRI

      if i have table with one col salary ------- 5 9 7 i want to make comboBox for each record in the database the probelm now how can make (onchange) even for each comboBox and save direct to database ... plz help

      Palestine

      P Offline
      P Offline
      Patricker
      wrote on last edited by
      #2

      I would do it something like this: Have a foreach statement. Inside that foreach statement create a new combobox. Then add the item to the combobox. You would need to make a method that was generic enough so that you could use it for all of your comboboxes that you make. This method would handle your On Selected Index Change Event. //thrown together, don't trust it to work without checking it over... foreach(datarow dr in table[0].rows) { ComboBox cb = new ComboBox(); //Make sure you give cb a unique name so that you can tell it apart from the other combos. cb.items.add("Pass in your value from the datarow here"); cb.WhateverThatChangeSelectedIndexEventIs += ThatEventITalkedAboutUpAbove(); //I'm sure you can manage to place the combobox on the form in a more exact way... this.controls.add(cb); } Should be something like that.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

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