Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

GridView custom SelectButton

Empfohlene Antworten

Veröffentlicht

Hallo,

ich brauche in meinem GridView einen SelectButton.

Leider kann ich über "AutoGenerateSelectButton" nicht gehen, da ich im DataBound-Event neue Zeilen hinzufüge, hier greift AutoGenerate anscheinend nicht.

Nun habe ich versucht über TableCell.Controls.Add() einen eigenen SelectButton hinzuzufügen. Dieser Button hat auch einen ClickEvent, dieser wird allerdings nicht gefeuert.

Hat jemand eine Idee, was ich machen könnte?

Code:

foreach (GridViewRow _arow in grid.Rows) //Alle Rows durchlaufen

                {

                        _newrow = new GridViewRow(_arow.RowIndex + _iIndex -1, _arow.RowIndex + _iIndex -1, DataControlRowType.DataRow, DataControlRowState.Normal); //neue Row erstellen

                        _newrow.BackColor = System.Drawing.Color.LightGoldenrodYellow;


                        //ImageButton erstellen

                        ImageButton btnSend = new ImageButton();

                        btnSend.ID = "btnSend" + _random.Next().ToString();

                        btnSend.ImageUrl = "Mail.png";

                        btnSend.AlternateText = "SendTo";

                        btnSend.Click += new ImageClickEventHandler(btnSend_Click);


                        TableCell _sendTo = new TableCell();

                        _sendTo.Controls.Add(btnSend);

                        _newrow.Cells.Add(_sendTo);


                        ... es werden noch weitere Cells hinzugefügt


                        _tab.Rows.AddAt(_arow.RowIndex + _iIndex, _newrow);  //neue Row zum Grid hinzufügen

                        _iIndex++;

                    }

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.