Hello everybody.
Sorry for my average english.
I develop an application in c# by means of library tik4net.
I would like to get all element in band menu in /interface/wireless.
An picture is more explicit :
I need your help please.
Hello everybody.
Sorry for my average english.
I develop an application in c# by means of library tik4net.
I would like to get all element in band menu in /interface/wireless.
An picture is more explicit :
I need your help please.
/interface wireless info print
Is that what your looking for?
sorry for late reponse.
That is not what i looking for.
thank you anyway.
anyone have a other idea. please
Nobody have idea please ?
Thank you in advance
You’ll want the ComboBox control. Check the DisplayMember property in particular.
i don’t understand .
my code :
i get only value in combobox selected but i want all element of combobox(see picture)
TikSession mks = new TikSession(TikConnectorType.Api);
string id = “”;
string data = “”;
string nom = “”;
string mac = “”;
string mode = “”;
string ssid = “”;
string band = “”;
string frequence = “”;
string pas = “”;
string profilSecu = “”;
string scan = “”;
string gain = “”;
mks.Open(textBox1_address.Text, textBox1_login.Text, textBox1_passwd.Text);
IApiConnector apiConnector = (IApiConnector)mks.Connector; //!!! MOST important row in sample
List macScanList = apiConnector.ApiExecuteReader(“/interface/wireless/print”,
new Dictionary<string, string>
{
{“advanced”,“”}
});
listView_radio.Items.Clear();
foreach (ITikEntityRow row in macScanList)
{
data = row.DataRow;
id = row.GetStringValueOrNull(“.id”, true);
nom = row.GetStringValueOrNull(“name”,true);
mac = row.GetStringValueOrNull(“mac-address”, true);
mode = row.GetStringValueOrNull(“mode”,true);
ssid = row.GetStringValueOrNull(“ssid”, true);
band= row.GetStringValueOrNull(“band”, true); // i get only value selected in combobox of winbox
frequence= row.GetStringValueOrNull(“frequency”, true);
pas = row.GetStringValueOrNull(“channel-width”, true);
profilSecu = row.GetStringValueOrNull(“security-profile”, true);
scan = row.GetStringValueOrNull(“scan-list”, true);
gain = row.GetStringValueOrNull(“antenna-gain”, true);
ListViewItem element = new ListViewItem(id);
element.SubItems.Add(nom);
element.SubItems.Add(mac);
element.SubItems.Add(mode);
element.SubItems.Add(band);
element.SubItems.Add(pas);
element.SubItems.Add(frequence);
element.SubItems.Add(ssid);
element.SubItems.Add(scan);
element.SubItems.Add(gain);
listView_radio.Items.AddRange(new ListViewItem { element }); // plot all element got in a listview
}
The ComboBox control is the one which displays items in a drop down menu from a textbox like field… it’s the “band menu” you’re looking for.
To populate the values, you need to fill up a list that you then give to the DataSource property, and set the DisplayMember property to the value of the list where the text is held. See the linked page for actual code on that part.
I’am going to see your advice.
but you must known i can’t put element(In a permanent way) in my program ,because my client speak with various electronics cards with various element in band menu.
for example :
in card 1 have 4 elements in combobox whereas in card 2 have 2 elements in combobox.
my client must get elements in fonction of electronic card
i don’t known that is clear with my english sorry .
When you need to replace the data, you just change the DataSource property of the combo box to a list with the new data in it.
ok ok