private void dataGridView1_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { if (e.RowIndex == -1) return; int val = 0; if (m_dataTable.Columns[e.ColumnIndex].DataType != typeof(string)) { if (m_dataTable.Columns[e.ColumnIndex].DataType == typeof(int)) val = Convert.ToInt32(dataGridView1[e.ColumnIndex, e.RowIndex].Value, CultureInfo.InvariantCulture); else if (m_dataTable.Columns[e.ColumnIndex].DataType == typeof(float)) val = (int)BitConverter.ToUInt32(BitConverter.GetBytes((float)dataGridView1[e.ColumnIndex, e.RowIndex].Value), 0); else val = (int)Convert.ToUInt32(dataGridView1[e.ColumnIndex, e.RowIndex].Value, CultureInfo.InvariantCulture); } else { if (!(m_reader is WDBReader)) val = (from k in m_reader.StringTable where string.Compare(k.Value, (string)dataGridView1[e.ColumnIndex, e.RowIndex].Value, StringComparison.Ordinal) == 0 select k.Key).FirstOrDefault(); } var sb = new StringBuilder(); sb.AppendFormat(CultureInfo.InvariantCulture, "Integer: {0:D}{1}", val, Environment.NewLine); sb.AppendFormat(new BinaryFormatter(), "HEX: {0:X}{1}", val, Environment.NewLine); sb.AppendFormat(new BinaryFormatter(), "BIN: {0:B}{1}", val, Environment.NewLine); sb.AppendFormat(CultureInfo.InvariantCulture, "Float: {0}{1}", BitConverter.ToSingle(BitConverter.GetBytes(val), 0), Environment.NewLine); //sb.AppendFormat(CultureInfo.InvariantCulture, "Double: {0}{1}", BitConverter.ToDouble(BitConverter.GetBytes(val), 0), Environment.NewLine); sb.AppendFormat(CultureInfo.InvariantCulture, "String: {0}{1}", !(m_reader is WDBReader) ? m_reader.StringTable[(int)val] : String.Empty, Environment.NewLine); e.ToolTipText = sb.ToString(); }
void dataGridView2_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { if (e.RowIndex >= 0 && e.ColumnIndex == 4) { SimplePluginDependency depItem = pluginDepBindSource[e.RowIndex] as SimplePluginDependency; if (depItem.CurrentVersion != null) e.ToolTipText = string.Format("since MediaPortal {0}", MediaPortal.Common.Utils.CompatibilityManager.MediaPortalReleaseForApiVersion(depItem.CurrentVersion)); } }
private void ChannelMapGrid_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { if (e.RowIndex < 0 || e.RowIndex >= channel_map_.Count) return; ChannelMapEntryWrapper entry_wrapper = channel_map_[e.RowIndex]; switch (ColumnIndexToEnum(e.ColumnIndex)) { case ColumnEnum.Status: switch (entry_wrapper.QAMStatus) { case QAMChannelStatus.ConflictingCCFirst: e.ToolTipText = "Another CableCARD™ channel with different EIA info is merged with this one, but the sources for this one are earlier in the merged channel."; break; case QAMChannelStatus.ConflictingCCNotFirst: e.ToolTipText = "Another CableCARD™ channel with different EIA info is merged with this one, and the sources for the other channel are earlier in the merged channel."; break; case QAMChannelStatus.ExistingDupeCCard: e.ToolTipText = "QAM source(s) matching this channel exist but are merged with another CableCARD™ channel."; break; case QAMChannelStatus.ExistingUnmerged: e.ToolTipText = "QAM source(s) matching this channel exist but are not merged with this or other CableCARD™ channels."; break; case QAMChannelStatus.IncorrectQAM: e.ToolTipText = "A QAM channel is merged with this one, but it does not match the QAM channel number and program ID for this channel from the channel map."; break; case QAMChannelStatus.NoCCChannelOrQAM: e.ToolTipText = "The CableCARD™ channel does not exist in your guide, and neither does a corresponding QAM channel."; break; case QAMChannelStatus.NoCCChannelWithQAM: e.ToolTipText = "The CableCARD™ channel does not exist in your guide, but a QAM channel with matching EIA number does."; break; case QAMChannelStatus.NotExisting: e.ToolTipText = "QAM sources for this channel do not yet exist in your guide. This is expected if the channel is encrypted."; break; case QAMChannelStatus.OTAOnly: e.ToolTipText = "QAM sources for this channel do not exist in your guide, and a channel with matching callsign exists in your local OTA lineup, so it should probably be there as ClearQAM."; break; case QAMChannelStatus.ProperlyMerged: e.ToolTipText = "QAM channel for this CableCARD™ channel already exists and is properly merged with it."; break; case QAMChannelStatus.ProperlyMergedWithExtraneousCCard: e.ToolTipText = "Both a matching QAM channel and CableCARD™ sources improperly using the EIA channel number are merged with this channel. These erroneous CableCARD™ sources should be removed as they will occupy a tuner until reboot if MCE tries to use them."; break; } break; case ColumnEnum.Action: e.ToolTipText = ChannelMapEntryWrapper.GetCorrectiveActionDescription(entry_wrapper.selected_action); break; } }
void dv_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { System.Diagnostics.Debug.WriteLine(e.ColumnIndex); System.Diagnostics.Debug.WriteLine(e.RowIndex); if (e.RowIndex >= 0) { string TransponderID = (tabControl1.SelectedTab.Controls[0] as System.Windows.Forms.DataGridView) .Rows[e.RowIndex].Cells["Transponder"].Value.ToString(); e.ToolTipText = IntelliTrack.Service.Common.Singleton<IntelliTrack.Client.Application.Imaging.ComplexMap>.Instance.GetFunctionValue(TransponderID); } else { e.ToolTipText = ""; } }
//Set tooltips for upcoming races table private static void upcoming_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { if (e.RowIndex > -1 && e.ColumnIndex == 1) { e.ToolTipText = string.Format("Click to jump to this race"); } if (e.RowIndex > -1 && e.ColumnIndex == 3) { var raceData = JSONHandler.ParseJSON<LeagueList[]>(Settings.Default.SeasonEventListURL); DateTime startTime = DateTime.ParseExact(raceData[e.RowIndex].startAt, "yyyy-MM-dd'T'HH:mm:ss'Z'", CultureInfo.CurrentCulture).ToLocalTime(); String timeBeforeRace = (startTime - DateTime.UtcNow).ToString(); e.ToolTipText = string.Format("Starts in: " + String.Format(timeBeforeRace, "{0:hh:mm:ss}").Substring(0, timeBeforeRace.LastIndexOf("."))); } if (e.RowIndex > -1 && e.ColumnIndex == 0) { e.ToolTipText = string.Format("Click to view official forum event page."); } }
[SuppressMessage("Microsoft.Usage", "CA2208:InstantiateArgumentExceptionsCorrectly")] // e.ColumnIndex / e.RowIndex is more precise than just e protected virtual void OnCellToolTipTextNeeded(DataGridViewCellToolTipTextNeededEventArgs e) { if (e.ColumnIndex >= this.Columns.Count) { throw new ArgumentOutOfRangeException("e.ColumnIndex"); } if (e.RowIndex >= this.Rows.Count) { throw new ArgumentOutOfRangeException("e.RowIndex"); } DataGridViewCellToolTipTextNeededEventHandler eh = this.Events[EVENT_DATAGRIDVIEWCELLTOOLTIPTEXTNEEDED] as DataGridViewCellToolTipTextNeededEventHandler; if (eh != null && !this.dataGridViewOper[DATAGRIDVIEWOPER_inDispose] && !this.IsDisposed) { eh(this, e); } }
internal string OnCellToolTipTextNeeded(int columnIndex, int rowIndex, string toolTipText) { DataGridViewCellToolTipTextNeededEventArgs dgvctttne = new DataGridViewCellToolTipTextNeededEventArgs(columnIndex, rowIndex, toolTipText); OnCellToolTipTextNeeded(dgvctttne); return dgvctttne.ToolTipText; }
void StreamDataGridView_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { if (e.RowIndex != -1 && StreamDataGridView.DataSource != null && StreamDataGridView.Rows.Count > 0) { StringBuilder toolTip = new StringBuilder(); foreach (string s in ((Feature)FeatureDataGridView.SelectedRows[0].DataBoundItem).Streams[e.RowIndex].ToolTip) toolTip.AppendFormat("{0}\r\n", s); e.ToolTipText = toolTip.ToString(); } }
private void dataGridView_CellToolTipTextNeeded( object sender, DataGridViewCellToolTipTextNeededEventArgs e ) { if( (e.RowIndex >= 0) && (e.ColumnIndex >= 0) && (dataGridView[e.ColumnIndex, e.RowIndex] is DataGridViewComboBoxCell) && (dataGridView.Rows[e.RowIndex].DataBoundItem is PoachProbability) ) { PoachProbability poach = dataGridView.Rows[e.RowIndex].DataBoundItem as PoachProbability; if( poach.Default != null ) { Item i = ReflectionHelpers.GetFieldOrProperty<Item>( poach.Default, dataGridView.Columns[e.ColumnIndex].DataPropertyName ); e.ToolTipText = "Default: " + i.Name; } } }
/// <summary> /// Shows the tooltip for the cell the mouse is hovering over. /// </summary> private void DGV_Layer_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { if (e.ColumnIndex < 0) return; if (DGV_Layer.Columns[e.ColumnIndex].Name == DGVC_Selectable.Name) { e.ToolTipText = LocalizationStrings.DGV_Selectable_Tooltip; } else if (DGV_Layer.Columns[e.ColumnIndex].Name == DGVC_Unselect.Name) { e.ToolTipText = LocalizationStrings.DGVC_Unselect_Tooltip; } else if (DGV_Layer.Columns[e.ColumnIndex].Name == DGVC_Count.Name) { e.ToolTipText = LocalizationStrings.DGVC_Count_Tooltip; } }
private void _grid_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { try { if (e.RowIndex >= 0) e.ToolTipText = _items[e.RowIndex].ToString(); } catch { } }
private void laps_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { if (e.ColumnIndex < 0 || e.RowIndex < 0) return; var obj = laps.Rows[e.RowIndex].Cells[e.ColumnIndex].Value; var tooltipTemplateText = Strings.ResourceManager.GetString("RoutePropertyNameAndValue_" + obj.GetType().Name); if (tooltipTemplateText == null) tooltipTemplateText = Strings.ResourceManager.GetString("RoutePropertyNameAndValue_" + obj.GetType().Name.Replace("FromStart", "")); if (tooltipTemplateText != null) e.ToolTipText = string.Format(tooltipTemplateText, obj); }
private void selectedWordDataGrid_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { if (e.RowIndex < 0) return; MatchWholeWord matchWholeWord = selectedWordDataGrid.Rows[e.RowIndex].DataBoundItem as MatchWholeWord; if (matchWholeWord.WholeWord) { e.ToolTipText = string.Format(CultureInfo.InvariantCulture, Properties.Resources.MATCH_WHOLE_WORD_TRUE, matchWholeWord.Word); } else { e.ToolTipText = string.Format(CultureInfo.InvariantCulture, Properties.Resources.MATCH_WHOLE_WORD_FALSE, matchWholeWord.Word); } }
private void dataGridView1_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { if (e.RowIndex == -1) return; ulong val = 0; Type dataType = m_dataTable.Columns[e.ColumnIndex].DataType; CultureInfo culture = CultureInfo.InvariantCulture; object value = dataGridView1[e.ColumnIndex, e.RowIndex].Value; //val = (ulong)Convert.ChangeType(value, dataType); if (dataType != typeof(string)) { if (dataType == typeof(sbyte)) val = (ulong)Convert.ToSByte(value, culture); else if (dataType == typeof(byte)) val = Convert.ToByte(value, culture); else if (dataType == typeof(short)) val = (ulong)Convert.ToInt16(value, culture); else if (dataType == typeof(ushort)) val = Convert.ToUInt16(value, culture); else if (dataType == typeof(int)) val = (ulong)Convert.ToInt32(value, culture); else if (dataType == typeof(uint)) val = Convert.ToUInt32(value, culture); else if (dataType == typeof(long)) val = (ulong)Convert.ToInt64(value, culture); else if (dataType == typeof(ulong)) val = Convert.ToUInt64(value, culture); else if (dataType == typeof(float)) val = BitConverter.ToUInt32(BitConverter.GetBytes((float)value), 0); else if (dataType == typeof(double)) val = BitConverter.ToUInt64(BitConverter.GetBytes((double)value), 0); else val = Convert.ToUInt32(value, culture); } else { if (!(m_dbreader is STLReader) && !m_dbreader.HasInlineStrings) val = (uint)(from k in m_dbreader.StringTable where string.Compare(k.Value, (string)value, StringComparison.Ordinal) == 0 select k.Key).FirstOrDefault(); } StringBuilder sb = new StringBuilder(); sb.AppendFormat(culture, "Integer: {0:D}{1}", val, Environment.NewLine); sb.AppendFormat(new BinaryFormatter(), "HEX: {0:X}{1}", val, Environment.NewLine); sb.AppendFormat(new BinaryFormatter(), "BIN: {0:B}{1}", val, Environment.NewLine); sb.AppendFormat(culture, "Float: {0}{1}", BitConverter.ToSingle(BitConverter.GetBytes(val), 0), Environment.NewLine); sb.AppendFormat(culture, "Double: {0}{1}", BitConverter.ToDouble(BitConverter.GetBytes(val), 0), Environment.NewLine); try { string strval; if (!m_dbreader.HasInlineStrings) strval = m_dbreader.StringTable[(int)val]; else strval = (string)value; sb.AppendFormat(culture, "String: {0}{1}", strval, Environment.NewLine); } catch { sb.AppendFormat(culture, "String: <empty>{0}", Environment.NewLine); } e.ToolTipText = sb.ToString(); }
public void dgBody_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { DataGridViewRow row = dgBody.Rows[e.RowIndex]; int insIndex = GetInstructionIndex(row); if (insIndex >= 0) { if (e.ColumnIndex == COL_OPCODE) { DataGridViewCell c = row.Cells[e.ColumnIndex]; string opCode = c.Value as string; e.ToolTipText = Utils.GetILHelp(opCode); } else if (e.ColumnIndex == COL_OPERAND) { Instruction ins = _currentMethod.Body.Instructions[insIndex]; object op = ins.Operand; if (op is FieldReference || op is FieldDefinition) { FieldReference fr = (FieldReference)op; FieldDefinition fd = (fr is FieldDefinition) ? (FieldDefinition)fr : DeobfUtils.Resolve(fr, _form.TreeViewHandler.GetLoadedAssemblyList(), null); if (fd != null && (fd.Attributes & FieldAttributes.HasFieldRVA) != 0) { e.ToolTipText = BytesUtils.BytesToHexStringBlock(fd.InitialValue); } else { e.ToolTipText = String.Format("{0}\r\n{1}", fr.ToString(), TokenUtils.GetFullMetadataTokenString(op is FieldDefinition ? fd.MetadataToken : fr.MetadataToken)); } } else if (op is MethodDefinition) { MethodDefinition md = (MethodDefinition)op; e.ToolTipText = String.Format("{0}\r\n{1}", md.ToString(), TokenUtils.GetFullMetadataTokenString(md.MetadataToken)); } else if (op is MethodReference) { MethodReference mr = (MethodReference)op; e.ToolTipText = String.Format("{0}\r\n{1}", mr.ToString(), TokenUtils.GetFullMetadataTokenString(mr.MetadataToken)); } else { DataGridViewCell c = row.Cells[e.ColumnIndex]; if (c.Value != null) { e.ToolTipText = c.Value.ToString(); } } } else if (e.ColumnIndex == COL_OFFSET) { MethodBody body = _currentMethod.Body; Instruction ins = body.Instructions[insIndex]; int rva = body.CodeRVA + ins.Offset; e.ToolTipText = String.Format("RVA: 0x{0:x}", rva); } } }
private void GvFilesCellToolTipTextNeeded( object sender, DataGridViewCellToolTipTextNeededEventArgs e ) { if (e.ColumnIndex != 1 || e.RowIndex < 0) return; SiqualFileDisplay file = (SiqualFileDisplay)gvFileList.Rows[e.RowIndex].DataBoundItem; e.ToolTipText = file.ErrorMessage; }
protected override void OnCellToolTipTextNeeded(DataGridViewCellToolTipTextNeededEventArgs e) { base.OnCellToolTipTextNeeded(e); if (wrapMode || (0 > e.RowIndex) || (0 > e.ColumnIndex)) return; String value; Model.get_field_repr(new NodeIdWrapper(e.RowIndex), e.ColumnIndex, out value); DataGridViewCell cell = Rows[e.RowIndex].Cells[e.ColumnIndex]; if ((cell.Size.Width < cell.PreferredSize.Width) || (cell.Size.Height < cell.PreferredSize.Height)) { e.ToolTipText = value; } else { Regex r = new Regex("\n"); Match m = r.Match(value); if (m.Success) e.ToolTipText = value; } }
private void dataGridView_CellToolTipTextNeeded( object sender, DataGridViewCellToolTipTextNeededEventArgs e) { //DataGridView dgrv( ); var dataGridView = sender as System.Windows.Forms.DataGridView; var dataTable = dataGridView.DataSource as DataTable; if( e.RowIndex >= 0 ) { string currentNodeName = dataTable.TableName; List<String> pathList = new List<string>(); pathList.Add( currentNodeName ); int currentRow = e.RowIndex; while( GetParentTableRow( ref currentNodeName, ref currentRow, currentNodeName, currentRow ) ) { pathList.Add( currentNodeName ); } pathList.Reverse(); string pathName = ""; string space = " "; foreach( string pathNode in pathList ) { if( pathName.Equals( "" ) ) { pathName = pathNode; } else { pathName = pathName + "\n" + space + "->" + pathNode; space += " "; } } e.ToolTipText = string.Format( pathName ); } else { e.ToolTipText = string.Format( "tip for row {0}, col {1}", e.RowIndex, e.ColumnIndex + dataTable.TableName ); } }
private void stockGV_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { try { if (e.RowIndex < 0 || e.RowIndex >= stockGV.Rows.Count) return; if (e.ColumnIndex < 0 || e.ColumnIndex >= stockGV.Columns .Count) return; if (stockGV.Columns[e.ColumnIndex] != codeColumn) return; databases.tmpDS.stockCodeRow row = (databases.tmpDS.stockCodeRow)((DataRowView)stockGV.Rows[e.RowIndex].DataBoundItem).Row; if (row == null) return; e.ToolTipText = (commonClass.SysLibs.IsUseVietnamese() ? row.name : (row.IsnameEnNull()?"":row.nameEn)); } catch (Exception er) { ErrorHandler(this, er); } }
private void dataGridView1_CellToolTipTextNeeded( object sender, DataGridViewCellToolTipTextNeededEventArgs e ) { if (e.RowIndex >= 0 && ((e.ColumnIndex >= salvageColumn.Index && e.ColumnIndex <= contestColumn.Index && propTypeBonuses != null && propTypeBonusesDefault != null ) || (e.ColumnIndex >= braveColumn.Index && e.ColumnIndex <= neutralColumn.Index && bfnBonuses != null && bfnBonusesDefault != null ))) { byte defaultValue = e.ColumnIndex <= contestColumn.Index ? GetPropTypeDefaultValue( e.RowIndex, e.ColumnIndex ) : GetBfnTypeDefaultValue( e.RowIndex, e.ColumnIndex ); e.ToolTipText = "Default: " + defaultValue.ToString(); } }
private void bookmarkDataGridView_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { if (e.ColumnIndex != 0 || e.RowIndex <= -1 || e.RowIndex >= this.bookmarkData.Bookmarks.Count) { return; } Bookmark bookmark = this.bookmarkData.Bookmarks[e.RowIndex]; if (!string.IsNullOrEmpty(bookmark.Text)) { e.ToolTipText = bookmark.Text; return; } }
private void dgvTrackCar_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { try { if ((e.ColumnIndex >= 0) && (e.RowIndex >= 0)) { string str = this.dgvTrackCar.Rows[e.RowIndex].Cells["CarNum"].Value.ToString(); string str2 = this.dgvTrackCar.Rows[e.RowIndex].Cells["CarId"].Value.ToString(); string str3 = this.dgvTrackCar.Rows[e.RowIndex].Cells["SimNum"].Value.ToString(); string str4 = this.dgvTrackCar.Rows[e.RowIndex].Cells["statuName"].Value.ToString(); string str5 = "车牌:" + str + "\r\n车号:" + str2 + "\r\n电话:" + str3 + "\r\n------------------------------\r\n状态:" + str4; e.ToolTipText = str5; } } catch { } }
private void dataGridView1_CellToolTipTextNeeded( object sender, DataGridViewCellToolTipTextNeededEventArgs e ) { if( (e.RowIndex >= 0) && (e.ColumnIndex >= 0) && (dataGridView1.Rows[e.RowIndex].DataBoundItem is Requirements) ) { Requirements reqs = dataGridView1.Rows[e.RowIndex].DataBoundItem as Requirements; if( reqs.Default != null ) { int i = ReflectionHelpers.GetFieldOrProperty<int>( reqs.Default, dataGridView1.Columns[e.ColumnIndex].DataPropertyName ); e.ToolTipText = "Default: " + i.ToString(); } } }
private void _dataGridView_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { if (e.RowIndex == -1 && string.IsNullOrEmpty(_columnHeaderTooltipBase)) return; var column = (ITableColumn)_dataGridView.Columns[e.ColumnIndex].Tag; e.ToolTipText = e.RowIndex == -1 ? string.Format("{0}: {1}", _columnHeaderTooltipBase, column.DisplayName) : column.GetTooltipText(_table.Items[e.RowIndex]); }
protected virtual void OnCellToolTipTextNeeded (DataGridViewCellToolTipTextNeededEventArgs e) { DataGridViewCellToolTipTextNeededEventHandler eh = (DataGridViewCellToolTipTextNeededEventHandler)(Events [CellToolTipTextNeededEvent]); if (eh != null) eh (this, e); }
/// <summary> /// 用于显示ToolTip提示信息 /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void dataGridView1_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { if (e.RowIndex != -1 && e.ColumnIndex != -1) { e.ToolTipText="双击显示"+this.dataGridView1.Rows[e.RowIndex].Cells["name"].Value.ToString()+"详细信息"; } }
private void dataGridView_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { if (e.ColumnIndex >= 0 && e.RowIndex >= 0) { DataRow row = this.dsVisualizacao.Tables[selectTabelName].Rows[e.RowIndex]; e.ToolTipText = string.Format("Row Values:{0}{1}-{2}-{3}-{4}", row.HasVersion(DataRowVersion.Current) ? string.Format("{1}- Current: {0}", row[e.ColumnIndex, DataRowVersion.Current], Environment.NewLine) : "", row.HasVersion(DataRowVersion.Original) ? string.Format("{1}- Original: {0}", row[e.ColumnIndex, DataRowVersion.Original], Environment.NewLine) : "", row.HasVersion(DataRowVersion.Proposed) ? string.Format("{1}- Proposed: {0}", row[e.ColumnIndex, DataRowVersion.Proposed], Environment.NewLine) : "", row.HasVersion(DataRowVersion.Default) ? string.Format("{1}- Default: {0}", row[e.ColumnIndex, DataRowVersion.Default], Environment.NewLine) : "", row.HasErrors && !string.IsNullOrEmpty(row.RowError) ? string.Format("{0}{0}Error: {1}", Environment.NewLine, row.GetColumnError(e.ColumnIndex)) : ""); } }
private void dgBody_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { BodyGridHandler.dgBody_CellToolTipTextNeeded(sender, e); }
void FeatureDataGridView_CellToolTipTextNeeded(object sender, DataGridViewCellToolTipTextNeededEventArgs e) { if(e.RowIndex != -1 && FeatureDataGridView.DataSource != null && FeatureDataGridView.Rows.Count > 0) { StringBuilder toolTip = new StringBuilder(); foreach (string s in features[e.RowIndex].ToolTip) toolTip.AppendFormat("{0}\r\n", s); e.ToolTipText = toolTip.ToString(); } }
private void dataGridView_CellToolTipTextNeeded( object sender, DataGridViewCellToolTipTextNeededEventArgs e ) { if( (e.RowIndex >= 0) && (e.ColumnIndex >= 0) && (dataGridView[e.ColumnIndex, e.RowIndex] is DataGridViewComboBoxCell) && (dataGridView.Rows[e.RowIndex].DataBoundItem is MonsterSkill) ) { MonsterSkill skill = dataGridView.Rows[e.RowIndex].DataBoundItem as MonsterSkill; if( skill.Default != null ) { Ability a = ReflectionHelpers.GetFieldOrProperty<Ability>( skill.Default, dataGridView.Columns[e.ColumnIndex].DataPropertyName ); e.ToolTipText = "Default: " + a.ToString(); } } }